Install apache mod rewrite on windows

In httpd.conf file the following line should be uncommented :

LoadModule rewrite_module modules/mod_rewrite.so

by removing the # sign before it.

Then comes a section which looks like this :

<Directory "C:/Apache2.2/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

The line :
AllowOverride None

should be made :
AllowOverride All

Restart Apache. Create a .htaccess file somewhere in htdocs and write some garbage text in it like akjsnajknda and save. Create a index.php along with the .htaccess file. Now open the index.php file in browser and you should get an Internal Server Error. This indicates that .htaccess file is wrong , which means that mod_rewrite is now active.







Last Updated On : 30th September 2009

Subscribe to get updates delivered to your inbox

Leave a comment