Test Your Custom Permalinks On Local WordPress Installation In Windows [Windows Mod Rewrite]

by Keith Dsouza | Translate | Print
Tuesday, 21st Oct 2008 | Share


Share Test Your Custom Permalinks On Local WordPress Installation In Windows [Windows Mod Rewrite] on Twitter Share Test Your Custom Permalinks On Local WordPress Installation In Windows [Windows Mod Rewrite] on Facebook Save Test Your Custom Permalinks On Local WordPress Installation In Windows [Windows Mod Rewrite] To Delicious Favorites Stumble Test Your Custom Permalinks On Local WordPress Installation In Windows [Windows Mod Rewrite] Share Test Your Custom Permalinks On Local WordPress Installation In Windows [Windows Mod Rewrite] on Digg Get Instant Updates as RSS Feeds from Techie Buzz

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.



Share

7 Responses so far | Share Your Opinions!

  1. Chetan Gole
    October 29th, 2008 at 12:54 am #

    Beside testing just perma links, we can test our whole wordpress installation on these virtual servers.
    Thanks for sharing this great trick.

    Reply to this comment

  2. Muhammad Ali
    November 3rd, 2008 at 1:18 am #

    Hi, on my wordpress, i have searched a lot, but not found any .htaccess file there, please tell me how wordpress do mode-rewite.

    Reply to this comment

    Jeremy Reply:

    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.

    Reply to this comment

  3. Robin
    November 6th, 2008 at 12:53 am #

    This works, thanks a lot!

    Reply to this comment

  4. Jeremy
    September 5th, 2009 at 7:58 am #

    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?

    Reply to this comment


Trackbacks

  1. نکته ها ، مقالات و ابزارهای وبلاگ (66 لینک) « لینکهای داغ از سراسر وب
  2. نکته ها ، مقالات و ابزارهای وبلاگ (66 لینک) | night media

Leave a Comment

Note: We discourage users from using keywords in their names while posting comments, most of them get caught by spam, also it really would be more fruitful in knowing people who comment by their real name, rather than by using a name no one relates to. In future we reserve the right to delete comments from users using a name other than their own.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>