How to make WordPress Permalinks work in Xampp

May 13, 2009

Xampp and similar localhost webservers that can be run from a local computer do not have mod_rewrite enabled by default. Furthermore, the AllowOverride directive is usually set to none, causing Apache to ignore an .htaccess file. If this is the case, your WordPress installation might return a 404 error, stating post not found and you would only be able to access your posts via a default permalink structure. I.E. http://localhost/?p=2. In the following simple solution, I show you how to make WordPress Permalinks work in Xampp and other localhost server installations. Upon completion, you will also have the ability to use .htaccess files on your local server.

How to make WordPress Permalinks work in Xampp:

Using a text editor, open your httpd.conf file. In Xampp, this file is found in the \apache\conf directory
Search the file for the following line of code:
#LoadModule rewrite_module modules/mod_rewrite.so

Next, remove the # from the line as seen below to enable the module:
LoadModule rewrite_module modules/mod_rewrite.so

Next, search the file for AllowOverride until you come to a section that looks like the following:
# 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 All

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

Ensure that this section says AllowOverride All as is highlighted above
Save the httpd.conf file and Restart your server
Login to your WordPress admin panel and set your custom permalink structure. Then go view your site. Custom permalinks should now work on your localhost Xampp or other server.

2 Responses to “How to make WordPress Permalinks work in Xampp”

  1. Thanks for this great tip. It saved me the day.

  2. I should email u about it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: