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 two copies of a folder in separate locations. They contain the exact same .htaccess file. Both .htaccess files have the same permissions and owners.

/home/sites/site/public_html/
/var/www/html/site/

I had a VirtualHost whose DocumentRoot used to point to /home/sites but I changed it to /var/www and restarted Apache.

Now my htaccess rules no longer work. For example, /story/id should rewrite to /index.php?id=$id. If I go to /index.php?id=$id in my browser, the page loads as it should, but if I go to /story/id I get a 404 error.

If I change DocumentRoot back to the old root, the links start working again.

Any ideas on what may be causing this?

share|improve this question
    
what does your htaccess file/s look like? –  qweet Feb 24 '12 at 0:08
    
I figured it out but thanks –  andrewtweber Feb 24 '12 at 0:24

1 Answer 1

up vote 2 down vote accepted

The solution was in the main httpd.conf file. AllowOverride was set to none for /var/www/html, which didn't matter before because the web folder was in /home/. Once we set that to All, the rewrite rules started working again.

share|improve this answer

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.