How to enable mod_rewrite in XAMPP

mod_rewrite is an Apache web server module which is used to rewrite a URL at the server level. This module has a variety of uses. But it is most frequently used to provide clean, search engine friendly URLs.

For example, if the original link is something like http://linuxandfriends.com/?q=wp ; Thanks to mod_rewrite, that link can be accessed by the end user and search engines as http://linuxandfriends.com/2008/12/wordpress/ which is a lot more friendlier.

Enabling mod_rewrite in XAMPP

XAMPP stands for Apache, MySQL, PHP and Perl. This is a software bundle which allows developers to easily install the above mentioned four software on their machine and test their websites. Apache Friends – the creators of XAMPP have released it for Windows, Linux and Mac OSX.

XAMPP comes with mod_rewrite module disabled by default. The following are the steps required to enable mod_rewrite module so that your websites such as WordPress blog, Drupal or Joomla sites can display search engine friendly URLs.

  1. Assuming you have unpacked the xampp folder in the C:\ directory, navigate to the folder containing the apache configuration files.  The full path is C:\xampp\apache\conf\.
  2. In the conf folder, you will find a file named httpd.conf. This file holds all the configuration parameters for apache. Open the file  in a text editor.
  3. Search for mod_rewrite.so and you will come across a line as follows : #LoadModule rewrite_module modules/mod_rewrite.so
  4. Uncomment the line by removing the hash (#) mark.
  5. Save  the file and restart Apache web server.

Now you will find that your site (WordPress, Drupal,Joomla) is able to use search engine friendly URLs.

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Related posts: