Welcome
Guest. Please
Login
or
Register
Client Area
|
Softaculous Cloud
|
Calendar
|
Quick Links
|
You are here:
Index
>
SitePad Website Builder
>
General Support
> Topic :
Why does sitepad add redirect to /
Threaded Mode
|
Print
Why does sitepad add redirect to /, every page is redirected to trailing / (0 Replies, Read 2118 times)
sales@topweb.wales
#
November 22, 2020, 12:27 pm
Group:
Member
Post Group: Newbie
Posts: 10
Status:
Hi,
I'd like to use in htaccess to force www and https without trailing / on files
To follow correct convention Url's should appear like:
https://www.website-hosting.company/
https://www.website-hosting.company/services
Code
# Turn on Rewrite Engine
RewriteEngine On
# Remove trailing slash from non-filepath urls
RewriteCond %{REQUEST_URI} /(.+)/$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^
https://www.website-hosting.company/%1
[R=301,L]
# Include trailing slash on directory
RewriteCond %{REQUEST_URI} !(.+)/$
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+)$
https://www.website-hosting.company/$1/
[R=301,L]
# Force HTTPS and WWW
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [OR,NC]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$
https://www.website-hosting.company/$1
[R=301,L]
BUT
Sitepad forces it's own redirect to add a trailing / to all url's and this causes a loop as I try to remove the trailing / from /services /contact etc
See the result here :
Code
>>>
http://website-hosting.company/services
> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
Status: 301 Moved Permanently
Code: 301
Date: Sun, 22 Nov 2020 12:24:38 GMT
Server: Apache/2.4.29 (Ubuntu)
Location:
https://www.website-hosting.company/services
Content-Length: 341
Connection: close
Content-Type: text/html; charset=iso-8859-1
>>>
https://www.website-hosting.company/services
> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------
Status: 301 Moved Permanently
Code: 301
Date: Sun, 22 Nov 2020 12:24:38 GMT
Server: Apache/2.4.29 (Ubuntu)
X-Redirect-By: SitePad
Strict-Transport-Security: max-age=31536000; preload
Location:
https://www.website-hosting.company/services/
Cache-Control: s-maxage=10
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8
>>>
https://www.website-hosting.company/services/
> --------------------------------------------
> 200 OK
the second redirect is not necessary.
IP:
--
« Previous
Next »
Threaded Mode
|
Print
Jump To :
Select a location to go to :
Home
Softaculous Inc.
|--News and Announcements
Softaculous Auto Installer
|--General Support
|--Suggestions
|--Languages and International Support
|--Themes and skins
|--Bugs
SitePad Website Builder
|--General Support
|--Suggestions
Pagelayer and PopularFX for WordPress
|--PopularFX
|--Pagelayer
Virtualizor - Virtual Server Control Panel
|--Pre-Sales
|--General Support
|--Languages and International Support
|--Suggestions
|--Bugs
Webuzo
|--General Support
|--Suggestions
|--Bugs
AMPPS
|--General Support
|--Suggestions
|--Bugs
General Stuff
|--General Discussions
|--Introduce Yourself
Users viewing this topic
1 guests, 0 users.
All times are GMT. The time now is September 25, 2024, 6:46 am.
Powered By AEF 1.0.8
© 2007-2008
Electron Inc.
Queries: 10 | Page Created In:0.024