Make WordPress Pretty Permalinks works in Windows Xampp

The first thing needed for make the WordPress Pretty Permalinks in local Xampp(//localhost or on sub folder), is to activate the Apache rewrite module. To activate Apache rewrite module open the httpd.conf file. In Xampp, this file is found in the \apache\conf directory, and un comment  the line

#LoadModule rewrite_module modules/mod_rewrite.so

by removing the #.

LoadModule rewrite_module modules/mod_rewrite.so

If u see no “#” in front of the don’t make any changes. This is general for all if u want to rewrite the local URL on Windows Xampp.

Next is to make it work for WordPress. To do that add the following code, to httpd.config file after the


<Directory "C:/xampp/htdocs">... .... ..... ..... ..</Directory>

Considering your  WordPress files are at C:/xampp/htdocs/wordpress and the URL is //localhost/wordpress …


<Directory "C:/xampp/htdocs/wordpress">
    Options +MultiViews +FollowSymLinks
    AllowOverride None
    
    
    Order allow,deny
    Allow from all
    
    = 2.3>
    Require all granted
    

    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [S=1]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
</Directory>

You can Install the WordPress on //localhost too and can have the WordPress Pretty Permalinks by removing “wordpress” form directory line and make the RewriteBase to localhost/. To install on sub folder and use some other name like “/subfoldername” in place of “wordpress”.

After done with the above changes you have to restart the Apache from Xampp Control Panel. That’s It.

Fell same awesomeness on development while working on local using WordPress Pretty Permalinks.

Content Difficulty Level : Beginner to Intermediate

Environment Used:

  • Windows 7
  • Xampp 3.2.1
  • WordPress 3.9.1