Quote:
Originally Posted by Jon
I've never had an issue with the provided code so this is strange. Perhaps try other code formats by google searching for: htaccess force trailing slashes
You could also talk to your host and ask them to turn on the trailing slashes as a server default.
|
Thanks Jon. I played around with my .htaccess file and discovered that the order of commands within this file is important: I changed the order of commands so that:
Code:
# ------------------------------------
# / WCM - Force trailing slashes
# ------------------------------------
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$
http://%{HTTP_HOST}/$1/ [L,R=301]
appears in the .htaccess before:
Code:
# ------------------------------------
# CDSEO Pro
# ------------------------------------
RewriteCond %{REQUEST_URI} !^/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ cdseopro.php
# ------------------------------------
# / CDSEO Pro
# ------------------------------------
and now I get the result I require, which is URLs without the trailing slash are 301 redirected to the URL with the slash.