0

I am working on drupal 7 site which needs to have a trailing slash at the end of urls for the taxonomy tags pages but not for the node pages which has the extention '.htm' .

I have tried this by editing .htaccess file of drupal , I added following code:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} !=/favicon.ico
#RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_URI} !*.htm
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://domain.com/$1/ [L,R=301] 

But this is not working for me. Can anybody suggest me how to get this done.

Note: I am working on light httpd server http://www.lighttpd.net/

Thanks in advance.

RageZ
  • 26,800
  • 12
  • 67
  • 76
saket
  • 114
  • 1
  • 2
  • 7

3 Answers3

0

Do you have this at the top of your .htaccess file in the root of domain.com? Is RewriteEngine on as below? Do other rules in your .htaccess file work, just not this one, and what happens when it does not work.

Try this code below, which is cleaned up a little

RewriteEngine On
RewriteBase /


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#is not an htm/l file
RewriteCond %{REQUEST_URI} !\.html?$ [NC]
#does not end with a slash
RewriteCond %{REQUEST_URI} !/$ 
RewriteRule ^(.+)$ http://domain.com/$1/ [L,R=301]
Ulrich Palha
  • 9,411
  • 3
  • 25
  • 31
0

Trailing Slash module for Drupal 7:

http://drupal.org/project/trailing_slash

Akaoni
  • 941
  • 1
  • 10
  • 13
-1

Lighty ignores .htaccess files.