Test Your Custom Permalinks On Local WordPress Installation In Windows [Windows Mod Rewrite]
By on October 21st, 2008

If you run WordPress on your local PC, chances are that you may not be testing it using custom permalinks, you may have on your actual website, the reason being that your default Apache configuration may give you 404 errors when you try to use custom permalinks.

apache-mod-rewrite-windows

This is because, a Apache installation on windows does not have mod_rewrite enabled by default. So if you are looking to test your custom permalinks on your local WordPress installation in Windows, you will have to enable it in the Apache configuration file (httpd.conf). Here are the directions on how you can do that.

Related: Creating SEO Friendly URLs using Mod Rewrite and PHP


Enabling Mod Rewrite On A Standalone Apache Server

There are several bundled packages that install Apache, MySQL and PHP with a single installation, but if you have installed stand alone copies of Apache, here are the instructions to enable mod rewrite on a standalone apache server installation.

Step 1: Navigate to Drive:\Apache Install Dir\conf folder, replace drive with the actual drive apache is installed in and the Apache Install Dir with the path to the Apache installation.

Step 2: Open the file named httpd.conf, and search for the text mod_rewrite, once you find the text, delete the #at the beginning of the line and save the file. The #in the configuration file symbolizes a comment.

enable-mod-rewrite-in-standalone-windows-apache-installations

Step 3: Save the httpd.conf file and restart Apache, once the changes have been made, go to your WordPress dashboard in your local installation and change the permalinks to use the custom URLs, you use on your live website.

Enabling Mod Rewrite In WampServer

If you use WampServer to run a test environment on your local PC, adding mod rewrite capabilities is fairly simple.

Step 1: Click on the Wampserver icon in the system tray and navigate to Apache.

Step 2: In the available sub-menu options, hover you mouse over Apache modules and navigate the module list till you find rewrite_module and click on it.

enable-mod-rewrite-in-wampserver-installations

Step 3: Once you have selected the option, wampserver will automatically restart the servers for the change to take effect. Once it has restarted, go to your WordPress dashboard in your local installation and change the permalinks to use the custom URLs, you use on your live website.

Enabling Mod Rewrite In XAMPP for Windows

If you are using XAMPP for Windows, which is another popular bundled test environment for a Windows PC, here are the instructions to enable mod_rewrite in Windows.

Step 1: Navigate to the XAMPP installation folder and open the apache\conf directory.

Step 2: From here you need to follow the steps as discussed in the standalone Apache instructions to uncomment the mod_rewrite in httpd.conf file

Step 3: Click on the XAMPP icon in the system tray and stop and start the Apache server. Once it has restarted, go to your WordPress dashboard in your local installation and change the permalinks to use the custom URLs, you use on your live website.

Hopefully enabling the mod_rewrite in your local test installations, will help you test your changes as you would see it on a live website.

Tags: , ,
Author: Keith Dsouza Google Profile for Keith Dsouza
I am the editor-in-chief and owner of Techie Buzz. I love coding and have contributed to several open source projects in the past. You can know more about me and my projects by visiting my Personal Website. I am also a social networking enthusiast and can be found active on twitter, you can follow Keith on twitter @keithdsouza. You can click on my name to visit my Google+ profile.

Keith Dsouza has written and can be contacted at keith@techie-buzz.com.

Leave a Reply

Name (required)

Website (optional)

 
    Warning: call_user_func() expects parameter 1 to be a valid callback, function 'advanced_comment' not found or invalid function name in /home/keith/techie-buzz.com/htdocs/wp-includes/comment-template.php on line 1694
 
Copyright 2006-2012 Techie Buzz. All Rights Reserved. Our content may not be reproduced on other websites. Content Delivery by MaxCDN