I just installed WampServer on Windows7 and uncommented mod_rewrite and set AllowOverride to All in the httpd.config file.

I created an .htacess file and placed it in the root folder with the following statement:

options +FollowSymLinks
RewriteEngine On

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

I then created test1.php file and placed it in the same folder as the .htacess file. However, I still must provide the extension on the browser to view the file. Am I doing something wrong?

Thank you,

link|improve this question
feedback

1 Answer

This .htaccess file worked for me:

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

You may also want to make sure that mod_rewrite.so is enabled in Apache's httpd.conf:

LoadModule rewrite_module modules/mod_rewrite.so
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.