Posted By

cyrilbatillat on 05/05/08


Tagged

url apache slash


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

AshMan
MicronXD


Remove trailing slash from url


 / Published in: Apache
 

URL: http://www.learndrupalcms.com/basic-drupal-site-configuration

  1. RewriteCond %{HTTP_HOST} ^your-domain.com$ [NC]
  2. RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]
  3.  
  4. or, if you have 'www' part in your domain name, add this instead:
  5.  
  6. RewriteCond %{HTTP_HOST} ^(www.)?your-domain\.com$ [NC]
  7. RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

Report this snippet  

You need to login to post a comment.