Test Your Custom Permalinks On Local WordPress Installation In Windows [Windows Mod Rewrite]
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.

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 Dirconf 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.

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.

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 apacheconf 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.
Comment Using Facebook
9 Responses to this Article | Share your Opinions/Comments
We moderate comments to prevent spam. Moderation is done within few hours. Please try and stay on topic and refrain from using abusive language. If you think there is a problem with this post, please email the post author or send us an email at tips@techie-buzz.com with the URL and the problem you see and we will rectify it as soon as we can.

Beside testing just perma links, we can test our whole wordpress installation on these virtual servers.
Thanks for sharing this great trick.
Hi, on my wordpress, i have searched a lot, but not found any .htaccess file there, please tell me how wordpress do mode-rewite.
If you go to the wordpress admin panel under “Settings->permalinks” change the permalinks style to “custom” and write “/%postname%/” (without the quotes) and save the changes. WordPress will create the .htaccess file for you in your wordpress root.
This works, thanks a lot!
The only problem is that I’ve enabled it and it still doesn’t work. There must be some kind of trick to this. And before you ask, yes, I uncommented the line, and yes the module is there, and yet I’ve restarted. The instructions are so easy there’s no way to mess them up. So why won’t it work?
Hi, thanks a bunch for your instructions. I uncommented loading the rewrite module. I copied a well functioning WordPress site to my localhost, everything works except for the page that with the url http://localhost/wp/products-page/ and the other similar ones. I am kind of new to WP, is this about permalinks or somthing else? I feel like it is a Apache setup as well.
This will not work until the following setting is enabled in the httpd.conf file
AllowOverride All