doesn't seem to work. Accoring to firefox, I've somehoew created a redirection loop. Does that mean that I can't redirect a file to it's rewritten version?
For example, the code below will take domain/file.php and allow the URL to be domain/file/ (in other words, both URLs will work).
PHP Code:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php
# Forces a trailing slash to be added
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
Since I don't want the domain/file.php to be active, I add a redirect to domain/file/ in order to avoid duplicate content.
PHP Code:
RewriteRule ^file.php$ domain.com/file/ [L,R=301]
After adding this line, if I point my browser to domain/file.php it times out in IE and Firefox says it's looping.
Bookmarks