Sunday, May 1, 2011

How to enable mod_rewrite in apache web server

How to enable mod_rewrite in apache web server

In Order to enable the clean urls and .htaccess, you need to enable the mod_rewrite in Apache server.

Before enabling clean urls, the Druapl Admin will look like below.
http://www.anji.com/?q=admin

After Enabling, the url looks like below
http://www.anji.com/admin
In Linux
If you want to enable mod_rewrite, then open your terminal and type the following command

sudo a2enmod rewrite


After execution of above command, then restart your apache server.

Use the following command to restart your apache web server.

sudo /etc/init.d/apache2 restart


You can see what modules are loaded by using the following command
sudo apache2ctl -l / sudo apache2ctl -M

In Windows
1) Click on WAMP server which is in system tray.
2) In that drag your mouse to Apache-> Apache module
3) It will give you list of modules of Apache, click on rewrite_module and restart your Apache server.

No comments:

Post a Comment