folder-openclocksearcharrow-rightarrow-leftmail4facebook2twittergithublinkedin

How to make WordPress Permalinks work in WAMP


If you run a local web server with WAMP you will find that it does 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://127.0.0.1/?p=2.

In the following simple solution, I show you how to make WordPress Permalinks work in WAMP 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 WAMP:

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

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

  6. Next, search the file for AllowOverride until you come to a section that looks like the following:
  7. # 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
  8. Ensure that this section says AllowOverride All as is highlighted above
  9. Save the httpd.conf file and Restart your server
  10. 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 WAMP or other server.

Post a comment


*