How To Enable mod_rewrite In LAMP- Ubuntu Linux

NOTE :  Follow below given steps  at your own risk .

1) give permissions to the /var/www/ directory

sudo chown -R $USER:$USER /var/www/

2) Install the Apache module mod_rewrite

a2enmod rewrite

3)  Chnage the directory and keep the back up of the file “000-default”

cd /etc/apache2/sites-enabled/

sudo cp  000-default 000-default1

4) Edit the file 000-default

sudo vi 000-default

Look for the below given code

Options Indexes FollowSymLinks MultiViews
AllowOverride none
Order allow,deny
allow from all

Modify “AllowOverride none” to “AllowOverride All”

5) Restart Apache

sudo /etc/init.d/apache2 restart

Leave a Reply

Your email address will not be published. Required fields are marked *