How to enable rewrite module in WAMP, XAMPP and Apache

Web programming topics
Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to enable rewrite module in WAMP, XAMPP and Apache

Post by Saman » Mon Jun 28, 2010 9:59 pm

If you are using XAMPP or WAMP, you will find that rewrite module (mod_rewrite) is not enabled by default. Here are the steps to enable it manually.
  1. Open apache’s configuration file using your favorite text editor. The configuration file generally locates at:

    Code: Select all

    {apache_dir}/conf/httpd.conf
    If you are using XAMPP or WAMP package then you will find the file at:

    Code: Select all

    {xampp_dir}/apache/conf/httpd.conf
    {wamp_dir}/apache/conf/httpd.conf
  2. Search for the following string:

    Code: Select all

    #LoadModule rewrite_module modules/mod_rewrite.so
    and uncomment it (remove the ‘#’ sign).
  3. Now search for another string AllowOverride None and make sure you find it within the section below.

    Code: Select all

    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
    </Directory>
    
    Replace AllowOverride None by AllowOverride All
  4. Finally save the changes, close your text editor and restart your apache server.
Post Reply

Return to “Web programming”