WordPress Permalinks will not work in a default XAMMP installation

wordpress-4-1-3XAMPP is a free and open source cross-platform web server package, comprised of an Apache HTTP Server, a MySQL database, PHP and Perl programming languages. It is easy to install and setup with little configuration. However, the default installation of XAMPP does not enable the permalinks, though the permalinks structure is customizable to create the .htaccess file.

With no permalinks, in the address bar, my blog will look like https://it.megocollector.com/?cat=65 as seen in the image below.


If the permalink is enabled, the WordPress blog returned a 404 error, the post not found. The reason is that mod_rewrite is not enabled in an XAMPP default installation. The AllowOverride directive in the Apache config file is also set to None by default; this would cause the Apache web server to ignore any .htaccess file, which used to rewrite the permalinks to the post’s actual url.

To enable the use of permalinks edit the httpd.conf with any text editor (ie. TextPad, Notepad++, Notepad.exe) located in the XAMPP installation (..\xampp\apache\conf).

The proceedure

  • Edit httpd.conf
  • locate the line
    #LoadModule rewrite_module modules/mod_rewrite.so
  • and remove the comment (#) from the line.
    LoadModule rewrite_module modules/mod_rewrite.so
  • locate the second instance of AllowOverride (contained inside the web server’s document root)
    AllowOverride None
  • and change None to All
    AllowOverride All
  • Restart the Apache.

The permalinks will be working after restart and the result is https://it.megocollector.com/category/linux