I currently have PHP scripts that work properly, being called like this:
- www.example.com/user.php/paul
- www.example.com/tag.php/food
I'm having trouble getting .htaccess to rewrite properly. I'm trying to achieve this:
- www.example.com/user/paul
- www.example.com/tag/food
So far, I can get it to redirect /user to /user.php, but the /paul is lost; breaking my script.
My current .htaccess looks like this:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET\ /([^.\ ]+\.)+php(\?[^\ ]*)?\ HTTP
RewriteRule ^(.+)\.php$ http://www.example.com/$1 [R=301,L]
RewriteRule ^([^/]+/)*index/?$ http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ http://www.example.com/$1 [R=301,L]
RewriteCond $1 !^([^.]+\.)+([a-z0-9]+)$ [NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*[^/])$ /$1.php [L]
Please help. Thanks! Paul