Thursday 4 October 2012

Add trails in all urls of website

Google search is very much based on '/' in the url's end. We can do it easily with htaccess. Here is the code.


### AR add trailing slash ######
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.example.com/$1/ [L,R=301]

Hope this would be useful for you!!

No comments:

Post a Comment