Search code examples
.htaccesswampserver

.htaccess doesn't work in WampServer 2.5


I have got a problem with .htaccess in WampServer 2.5.

I use Windows 10 Enterprise and have installed wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-64b_August_2015 on it.

Every thing is going well except .htaccess configs. I want .php extention removed from website url like (www.mywebsite.com/contact.php) should look like (www.mywebsite.com/contact), but it doesn't work and displays (404 Not Found error).

The URLs link is like:

<a href="contact">link</a>

But when adding .php extention at the link :

<a href="contact.php">link</a>

it works.

I use this bunch of codes in my .htaccess :

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
  # Options +SymLinksIfOwnerMatch
    RewriteEngine On 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME}\.php -f 
    RewriteRule ^(.*)$ $1.php
  # RewriteBase /
</IfModule>

I also tried some other codes like above, but no results. Previously in windows 8.1 and wampserver2.2 it was waroking, but now in wamp2.5 it puts me in trouble. how should i get it solved?


Solution

  • check this youtube step by step tutorial related to enable rewrite module in wamp apache https://youtu.be/xIspOX9FuVU?t=1m43s Wamp server icon -> Apache -> Apache Modules and check the rewrite module option