.htaccess rules not working, but the file seems to be loaded

Posted by user221877 on Server Fault See other posts from Server Fault or by user221877
Published on 2014-05-29T14:21:12Z Indexed on 2014/05/29 15:29 UTC
Read the original article Hit count: 148

Filed under:

I am trying to remove .php at the end of the URL from any page thats loaded.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

Its running on my own server, which has WHM/cPanel, so I can change settings at the server level, I'm just not really sure what I'm looking for. I found the httpd.conf file, but it said it was auto generated by whm, so I tried looking in whm for the correct settings but it had barely any settings related to htaccess. If I fill htaccess with gibberish it stops the site from loading, which I assume means that the .htaccess file is being loaded, so I'm not sure what the issue is.

© Server Fault or respective owner

Related posts about .htaccess