Enabling .htaccess in Apache on Windows

By default XAMPP and similar Apache Web Servers that can be run from Windows do not have mod_rewrite enabled. This causes Apache to ignore an .htaccess file. In the following simple solution, I show you how to enable mod_rewrite to enable the use of .htaccess on Apache servers in Windows like XAMPP. Moreover, this allows you to create nice permalinks for software like WordPress.

How to enable or use .htaccess on Apache Web Servers in Windows:

  1. Using a text editor, open the httpd.conf file. In XAMPP, this file is found in the \apache\conf directory
  2. Locate the following line of code:

    #LoadModule rewrite_module modules/mod_rewrite.so

  3. Remove the # from the line as seen below to enable the module:

    LoadModule rewrite_module modules/mod_rewrite.so

  4. Save the httpd.conf file and Restart your server
  5. Restart your Apache Server

If all goes well, you should now be able to use .htaccess files.