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)


2 Answers 2


Try add

AllowOverride All

inside tag.

  • 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, 2010 at 13:21
  • It should be inside the Directory tag for your DocumentRoot, which I believe you didn't post here.
    – Jeremy L
    Jan 9, 2010 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: https://stackoverflow.com/questions/1608589/how-to-enable-htaccess-in-httpd-conf-on-xp

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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