Yuval Hayke Yuval Hayke - 1 year ago 76
Apache Configuration Question

Htaccess file not working (like it doesnt exist)

Alright, so this is pretty frustrating for me. I have a simple php website and want I wanted is to remove the page extension (index.php to index). from what I read from guides, everyone pointed out that all I need to do is create a .htaccess file and paste this code in it.

RewriteEngine on
RewriteCond %{REQUEST_URI} !\.php$ [NC]
RewriteCond %{REQUEST_URI} [^/]$
RewriteRule ^(.*)$ $1.php [L]

After doing so, I saw no change.
after some testing, I noticed that even if the file contains errors (by just writing "TEST" in the file) nothing happens. So I guess I'm clearly missing something and could really use some help.

Answer Source

You need to have fullfilled these necessary conditions.

  1. Need to have your webpages on apache server
  2. Need to have .htaccess file in appropriate directory, where you want influence
  3. In appropriate apache conf file you need to have this directive AllowOverride All. When you don't have this or have AllowOverride None, apache disregards .htaccess in your directory.

I think, you don't have properly configured third point.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download