0

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

1
  • There's probably a syntax error in your .htaccess file. Can you provide the contents of your .htaccess file, and take a look in the ErrorLog (/var/log/apache2/error.log) Commented Jul 10, 2009 at 23:12

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

I always toss a <IfModule mod_rewrite.c> stuff here </IfModule> block around my rewrites. Now I'm kinda curious... If I were in your shoes would this have significantly delayed me figuring out that rewrite wasn't enabled?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.