View Single Post
  #702  
Old 03-11-2013, 04:57 AM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: CDSEO Pro - Complete SEO Solution - Custom Urls, Page Titles, Meta Data, Link Anchors

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.
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote