Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have my apache server set up to read from settings. Everything works except mod_rewrite

eg.

<VirtualHost *>
        ServerAdmin 
        ServerName 
        ServerAlias www.
        DocumentRoot /home/sitehome

        <Directory />
        ServerSignature Off
        Options -Indexes
        DirectoryIndex index.php

        RewriteEngine On
        RewriteBase /
        RewriteRule ^index\.html$ index.php [NC,L]
        </Directory>

</VirtualHost>

Apache won't follow the rewrite rules, and say that "index.html" doesn't exist, but if I put a .htaccess file in the sitehome directory, it'll read that and apply the rewrite rules correctly.

Why would this happen?

System: Ubuntu 7.10 Gutsy with Apache2

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

Shouldn't your Directory directive look more like this:

<Directory /srv/www/htdocs/>
share|improve this answer
    
Wow, that worked. Thanks a bunch! –  Richard Sep 23 '09 at 4:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.