• Archives

  • Categories

Dec 23

How to enable Apache mod rewrite in Ubuntu

Actually this probably works for all Linux distributions with Apache 2. Okay enabling mod_rewrite is really easy, you just have to use a2enmod (Apache 2 enable module):

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

To disable an Apache 2 module, you can run:

sudo a2dismod rewrite
sudo /etc/init.d/apache2 restart

That does the reverse.

With mod_rewrite enabled, you can use the .htaccess file.

By the way in your directory permissions, you must set AllowOverride to “all” like this:

<Directory /home/kahwee/projects/whatever>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride all
  Order allow,deny
  allow from all
</Directory>

Hope it helps.

Possibly related:

  1. How to set up VirtualHost in Ubuntu
  2. How to set up VirtualHost in XAMPP for Windows
  3. Tonight I’ll fix the server
  4. My disk got full

No comments yet. Leave yours here.


WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.