How to enable Apache mod rewrite in Ubuntu

March 04, 2010
By bastola No Comments

To Enable a rewrite Module

sudo a2enmod rewrite

sudo /etc/init.d/apache2 restart

To Disable a rewrite Module

sudo a2dismod rewrite

sudo /etc/init.d/apache2 restart

Now if you want to use .htaccess working, you must set the directory permission accordingly. You have to edit /etc/apache2/sites-available/default. For this, open this file in your preferred text editor. For me, its gedit.

sudo gedit /etc/apache2/sites-available/default

Then set the permission as shown below i.e. change AllowOverride None to AllowOverride all 

<Directory /home/kahwee/projects/whatever>

  Options Indexes FollowSymLinks MultiViews

  AllowOverride all

  Order allow,deny

  allow from all

</Directory> 

sudo /etc/init.d/apache2 restart

And enjoy!

Comments

Post Your Comment




Recent Posts

What still is Microsoft doing on IEs?

By bhupal on March 17, 2010

My Personal Experince, A normal day on my office ... read more +

PHP Random Image Rotation

By ghanashyam on March 11, 2010

 Want some randomness on your website? Try ou ... read more +

ubuntu enable curl module in php

By bastola on March 09, 2010

sudo apt-get install curl libcurl3 libcurl3-dev ... read more +

How to enable Apache mod rewrite in Ubuntu

By bastola on March 04, 2010

To Enable a rewrite Module sudo a2enmod rewrite ... read more +

An "essential" document for mobile web designers

By bhupal on February 26, 2010

We've often maintained that 2008 will be the offic ... read more +

Archives