Home > Computers, Linux, Operating Systems > Apache2 and .htaccess with mod_rewrite on Ubuntu 8.04 (Hardy Heron)

Apache2 and .htaccess with mod_rewrite on Ubuntu 8.04 (Hardy Heron)

Apparently the default settings for .htaccess files and URL rewrites in Ubuntu (8.04 anyway) is kinda jacked. Apache wasn’t seeing my .htaccess files, and even after setting up the configuration correctly, I was getting Internal Server (500) errors from .htaccess files.

The default setting for Apache2 on Ubuntu for .htaccess is “ignore it”. You need to enable it by going to /etc/apache2/sites-available/default and changing the AllowOverride directive, which you can find inside the <Directory> … </Directory> tags:

AllowOverride ALL

If you want to enable URL rewrites, you need to enable the mod_rewrite module as it is not enabled by default:

[11:31:14] vivin@dauntless ~/Projects/www/skyblue
$ sudo a2enmod rewrite
Module rewrite installed; run /etc/init.d/apache2 force-reload to enable.

[11:31:20] vivin@dauntless ~/Projects/www/skyblue
$ sudo /etc/init.d/apache2 force-reload
 * Reloading web server config apache2

Related Posts

  1. bob
    September 1st, 2009 at 05:53 | #1

    Thank you – saved my day!

  2. September 9th, 2009 at 16:25 | #2

    @bob
    Glad I was able to help!

  3. February 25th, 2010 at 15:32 | #3

    Hi . hope this will help you and help every body looking for the same solution:
    u need to open appche2.conf and add the domian name like this : ServerName=’example.com’
    if you are working localhost, then ServerName=’localhost’
    and then reload the server
    :o )

  1. September 16th, 2009 at 14:23 | #1