How to enable mod_rewrite in apache2

Valic —  October 10, 2010 — 1 Comment

1. First install the apache with this command:

apt-get install apache2

2. Now use locate to find if the mod_rewrite.so is availble on your server:

updatedb

locate mod_rewrite.so

it will found in “/usr/lib/apache2/modules”

3. New apache follow some folders to enable and disable mods so now do this:

cd /etc/apache2/mods-enabled

touch rewrite.load

vim rewrite.load (you may use any editor to edit this file)

4. Now paste this following line:

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

5. Then edit:

/etc/apache2/sites-available/default

6. Find the following:

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Order allow,deny

allow from all

And change it to:

Options Indexes FollowSymLinks MultiViews

AllowOverride all

Order allow,deny

allow from all

And finally restart Apache:

/etc/init.d/apache2 restart

DONE!

Valic

Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

One response to How to enable mod_rewrite in apache2

  1. Or.. you can use: “a2enmod rewrite” + restart Apache

Leave a Reply