A friend of mine working in localhost and when he try to change the permalink structure to a custom permalink or to any other permalink and unfortunately all his site pages goes to 404 error page not found and he could only access the default permalink structure which is e.g. http://localhost/?p=1, this time I will try to explain why it happen and give you possible solution.

Okay, let’s start.

The reason why it happen is because Apache module mod_rewrite and AllowOverride directive are both disable by default and if you change permalink structure, WordPress use .htaccess files and in order for .htaccess to work properly you need to enable Apache module and AllowOverride directive that is usually set to none.


And now the httpd.conf is open in notepad, press Ctrl + F to search, type mod_rewrite.so in the text field.
You notice that the line has hash “#” on the left side; now all you need to do is remove the hash



Now search AllowOverride until you reach something similar below.

Change the above lines to these.

After changing those lines above, now save the file.

In order the changes to take effect you need to restart services, to do that click the green icon or the WAMP server icon and click Restart All Services, wait for a few seconds until the green icon back to its original color.

Method 2:

Now instead of editing httpd.conf which is quite long method will do just check the module we want to enable and it’s pretty easy.

Select Apache –> Apache Modules –> and that will display the lists of available modules now just check rewrite_module

That’s it, change the permalink structure again and refresh your site.

Let me know if you’re in any trouble, use the comment box below to add your thoughts.

Leave A Reply

Your email address will not be published.