Become Wordpress Professional - Your Ultimate Wordpress Guide

Sunday, 17 March 2013

How to fix 404 errors of wordpress sites on WAMP - Localhost

There are a lot of people who face 404 errors saying "requested URL not found on this URL" upon opening up pages in a wordpress site on their localhost (WAMP) after installation of wordpress and changing permalink structure to search engine friendly.

Reason for the error

The reason for this weird error is that by default WAMP server has a lot of features that are disabled. Mod_rewrite feature in apache settings is also disabled by default that causes apache server not to recognize the permalink structure because the rewrite rules are not yet set. 

Fixing 404 page errors in wordpress site on WAMP (localhost)

In order to fix the error, there is just a single setting "Mod_rewrite" that needs to be enabled. Follow along with the guide to configure apache settings.

There are two ways to fix this issue:

1) Enabling Mod_rewrite from Apache Modules settings

First of all start your WAMP server. Then locate the WAMP icon that is green in color placed on the bottom right corner in the task bar as shown in the image below:

wamp icon

Righ Click on the WAMP icon and that will popup the menu and then hover your mouse over the "Apache" which will make a sub-menu appear. Then hover your mouse over "Apache Modules" as shown in the image below:

By hovering mouse on "Apache Modules", you will be able to see a long list of options. Find the "rewrite_module" option and click to activate it. Refer the image below:

Now that you have technically asked apache to include rewrite module, that should fix the 404 errors and check to see, now your pages would be working fine.

There is another way you can fix the same issue by the following method:

Note: If you have already followed the first method, you do not need to go for the second method too, that is just for extra informational purpose

2) Enabling the Mod_rewrite from httpd.conf Apache configuration file

Right Click on the WAMP icon, hover over "Apache" and click on "httpd.conf" file:

Clicking on the "httpd.conf" file will open up the apache configuration file in a notepad.
Next Press CTRL+F on your keyboard and search for they keyword "mod_rewrite" remove the # from the line found in the notepad, save the file and close it as mentioned in the image below:


That is it, you have just enabled the mod_rewrite module and you wont be facing 404 errors in your wordpress site installed on your local server.


Post a Comment

Please Avoid Spamming. Comments will be moderated before they are published.