Academic and Career Talks

Talk about Academic Life and Career

Codes and Scripts

Articles with Code Snippets, programming, source codes, and useful scripts for development

Computers, Gadgets and Mobile Reviews

Gadget and Mobile Reviews

IBM DB2, Lotus Notes, Cognos

IBM, DB2, Lotus Notes, Cognos

Wordpress, Blogging and Useful Stuffs

Wordpress, Blogging and Useful Stuffs

Home » Wordpress, Blogging and Useful Stuffs

How to make WordPress Permalinks work in Localhost

Submitted by on Thursday, 19 March 200920 Comments
How to make WordPress Permalinks work in Localhost

The other day i was playing around on my local WordPress installation when this error message appeared on my screen saying…

Not Found

The requested URL /Techronnati/wordpress/ibm-db2-cognos-tivoli-websphere-microsoft-google.html was not found on this server.

I was surprised. As a matter of fact, i was not expecting that to happen. Now you may probably ask, what the heck i was doing all along? You see, I was playing around on my wordpress’ permalinks structure, pretty much learning about Search Engine Optimization in the WordPress CMS. And so without much idea, i delved in and tried to investigate one by one that’s causing this error. Later on, i found out that WAMP or any other similar localhost webservers that can be run from a local computer do not have mod_rewrite enabled by default. I also discovered that the AllowOverride directive is set to none by default WAMP server installation, 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/yourwebsitefolder/?p=2. Collecting some information i got, here’s what i did.

    1. Using a text editor, open your httpd.conf file. In WAMP server, this file can be found in the \apache\conf directory
    2. Sift for the following line of code in that file.

      #LoadModule rewrite_module modules/mod_rewrite.so

    3. Next, remove the # from the line as seen below to enable the module: Just for information, # symbol is actually a comment syntax for httpd.conf. So this should look like this.

      LoadModule rewrite_module modules/mod_rewrite.so

    4. Then, search for AllowOverride in this httpd.conf file until you come to a line similar of the following:

      <Directory />
      Options FollowSymLinks
      AllowOverride none
      Order deny,allow
      Deny from all
      </Directory>

    5. Verify if AllowOverride All is indicated. Change “none” to “all” if found otherwise so this should look like this.

<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>

  1. Save the httpd.conf file and Restart your wamp server. (Click on the ‘moon’ in the icon tray and select Restart Services)
  2. Login to your WordPress admin panel and set your custom permalink structure as desired. Then go view your site. Custom permalinks should now work on your localhost WAMP/XAMPP or other server.

Happy Blogging everyone. 🙂

For more information, feel free to browse over the Techronnati boards

 

Thank you for visiting Techronnati.com. I hope you enjoy your stay. =)
Close Box