Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My live site reads the .htaccess fine. I got 404.php and mod_rewrite working fine there, but on my localhost... nothing.

  • PHPmyAdmin 3.1.5
  • PHP 5.2.9-2
  • Apache 2.2

My .htaccess is this:

ErrorDocument 404 /404.php

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteRule ^news/([0-9]+)-(.*)\.html$ news/index.php?id=$1 [L]

Reading http://localhost/phpinfo.php reveals that mod_rewrite is turned on, but it doesn't work, neither does the 404.php page. The Apache error logs only reveal that the page was not found on this server.

My httpd.conf currently looks like this:

DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

<Directory />
    Options FollowSymLinks
    Order Allow,Deny
    Allow from
    Deny from All

I can change it to any combination you want, but it won't do anything. Where else could the source of my headaches be? What am I missing?

Thanks, signed, noob (at technical stuff)

share|improve this question

migrated from Jan 9 '10 at 14:33

This question came from our site for professional and enthusiast programmers.

Try add

AllowOverride All

inside tag.

share|improve this answer
Tried it, restarted Apache Server. Still nothing. The problem is likely somewhere in how my local server is reading the page, not so much the allow,deny. I've tried every combination of that. – Bryan Jan 9 '10 at 13:21
It should be inside the Directory tag for your DocumentRoot, which I believe you didn't post here. – Nerdling Jan 9 '10 at 13:53

Praise the lord and pass the ammunition.

This post pointed me to the answer, and the people were led out of the desert:

My file was saved as "htaccess" not ".htaccess". The first time I saved the file, I certainly added the dot, but Windows dropped it when saving the filename. Just now I opened it with Notepadd++ and renamed it ".htaccess" and violá!

Man, this should not be this difficult...

share|improve this answer

Your Answer


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.