I have a simple .htaccess file to rewrite www.domain.com/foobar.php
to www.domain.com/foobar
RewriteEngine On
RewriteRule foobar foobar.php [L]
It is giving me a 404 even though I ran phpinfo();
(which shows the mod_rewrite
module), and checked httpd.conf
(which uses mod_rewrite
several times by default).
Any suggestions?
The most possible reason for this is that you haven’t set ‘AllowOverride’ to at least ‘FileInfo’ at your configuration.
Check more discussion of this question.