How to hide php extension using a .htaccess and still keep the path_info
superglobal accessible
I wonder what is the correct way to hide php extension from urls when
using a .htaccess. Currently I have my .htaccess like this:
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+\.php)$/(.+)$/(.+)$/$ /$1.php/$2/$3 [S]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ /$1.php [L,QSA]
The above second rule is because I have to keep the PHP_INFO accessible
when giving a url like this: xxx/vision.php/2013/Enero
And in the htdocs directory I have AllowOverridde Options and it is set up
like this:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
But it's giving me an Internal Server Error whenever I try to access the
server document root. Perhaps someone is able to point me in the right
direction, and hopefully soon cause I'm in a hurry
No comments:
Post a Comment