mod_rewrite - can't combine rules

Posted by mikua on Stack Overflow See other posts from Stack Overflow or by mikua
Published on 2010-12-22T13:48:34Z Indexed on 2010/12/22 13:54 UTC
Read the original article Hit count: 194

Filed under:

I have 3 rules:

  # DEL www. from URL
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] 
  RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 

  # DEL /index.php fron URL
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
  RewriteRule ^(([^/]+/)*)index\.php$ http://masterok.kiev.ua/$1 [R=301,L]

  # ADD / to URL
  RewriteRule  ^([^.]+[^./])$ /$1/  [R=301,L]

All the rules work individually, but when you use them at the same time - there is a looping and the site don't open...

Help please to combine them

© Stack Overflow or respective owner

Related posts about mod-rewrite