Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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,

share|improve this question
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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