I've done some research into this and cannot for the life of me, wrap my head around it...
I'm trying to redirect incoming urls ending with a .php extension to extensionless urls. I need the code to be generic as the .htaccess file will be used on separate websites.
trying to get http://website.com/file.php to look like http://website.com/file/
her is the code I thought would work, but doesn't:
Code:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)\.php/\ HTTP/
RewriteRule ^(.+)\.php/$ http://%{HTTP_HOST}/$1/ [R=301,L]
Here is what's in the .htaccess file already (this is needed for the CMS for the site):
Code:
<IfModule mod_php4.c>
php_value session.use_only_cookies 1
php_value session.use_trans_sid 0
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [QSA,L]
</IfModule>
Any help for this newb would be appreciated.