Ian Burris
Ian Burris

Reputation: 6515

Problem enabling .htaccess

I'm trying to enable .htaccess files on a Ubuntu server I set up. I changed the sites file from:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    [unnecessary config code omitted]

</VirtualHost>

to

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/document_root
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/document_root>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    [unnecessary config code omitted]

</VirtualHost>

Now when I try to view a page in my browser I get a 500 Internal Server Error. Any ideas as to what my problem may be? Thanks for the help.

EDIT

Here is my .htaccess file:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

I checked the apache error logs as requested and it appears that the error being logged is:

[Fri Jul 10 19:39:12 2009] [alert] [client 192.168.1.1] /var/www/document_root/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Upvotes: 0

Views: 325

Answers (1)

Ian Burris
Ian Burris

Reputation: 6515

Bah... I didn't have mod_rewrite enabled. I feel stupid.

Upvotes: 1

Related Questions