Forum Moderators: phranque
I have discussed this before and as was recommended I changed my host.
What I'm trying to do is:
1. Redirect non-www domains to www domains
2. Remove index.php from all urls
3. Add trailing slash to url if missing
This is what I'm using write now [thanks to Jim]
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI}!(\.[^/]+¦/)$
RewriteRule (.+) /$1/
RewriteCond %{HTTP_HOST}!^www.
RewriteRule (.*) [%{HTTP_HOST}...] [R=301,L]
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule (.*) index.php?$1 [L]
----
The trailing slash is not being added. This is the issue now.
http:/example.com/a/b
Redirects to
http:/www.example.com/a/b
Not
http:/www.example.com/a/b/
Warm Regards
Would someone please correct any posible mistakes in this?
RewriteEngine on
RewriteBase /
RewriteRule ^([^\.]+[^/])$ [%{HTTP_HOST}...] [L]
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule (.*) index.php?$1 [L]
RewriteCond %{HTTP_HOST}!^www\.
RewriteRule ^(.*)$ [%{HTTP_HOST}...] [R=301,L]