The code inside my .htaccess file is:
# Do not remove this line or mod_rewrite rules and search engine friendly URLs will stop working
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Is this code all right?
I was told that this would ensure that I can access my files without typing .php in the browser. However, this is not the case. I'm using WampServer Version 2.5. I've already ensured that rewrite_module
is turned on in the apache modules, and ensured it's on in httpd.conf. My port 80 is used by apache itself.
So why can't I access the page without typing the extension? I get a 404 Error when I try to do so.
EDIT : I tried the solution provided Here, with the new code being:
# Do not remove this line or mod_rewrite rules and search engine friendly URLs will stop working
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [L]
But it still returns a 404 Error. Why is this happening?
NOT FOUND. The requested URL /SomuFinanceAJAX/bill/billMaker/index was not found on this server.