Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    .htaccess has no effect on Apache

    Hi. I'm trying to get a custom 404 to work on Apache. I have done the following:

    1) I made a plain text document called .htaccess and put it into the root of my web accessable directory ( /var/www/htdocs on my slackware box ). The .htaccess document contains the following line

    ErrorDocument 404 /errors/404.html
    I then made the special 404 file and put it into /var/www/htdocs/errors/ After I did that, in my browser typed in a non-existent file-name in my domain into the location bar, I still got the regular default apache 404:

    Not Found
    The requested URL /3213 was not found on this server.

    Apache/1.3.31 Server at Port 80
    2) I then read some more docs and learned that I need to tell httpd.conf to allow .htaccess to override its settings, which I did by making sure this was in my httpd.conf file:
    AllowOverride FileInfo
    It still didn't work when I tested it in the browser.

    3) I asked a couple friends for help, we tried taking out the leading slash in the .htaccess file's relative URL, and that didn't work. We changed the note in httpd.conf to "AllowOverride All" and that didn't do anything. We tried a couple other oddball long-shot things that didn't work either.

    4) I read this:

    .htaccess file doesn't seem to change anything
    It's possible that the directory is within the scope of an AllowOverride None directive. Try putting a line of gibberish in the .htaccess file and force a reload of the page. If you still get the same page instead of an 'Internal Server Error' display, then this is probably the cause of the problem. Another slight possibility is that the document you're requesting isn't actually controlled by the .htaccess file you're editing; this can sometimes happen if you're accessing a document with a common name, such as index.html. If there's any chance of this, try changing the actual document and requesting it again to make sure you can see the change. this isn't happening.
    I did what it suggested and found nothing.

    Just to let you know, the webpage for the special 404 does work. You can see it at

    I have no idea why this isn't working. I'm pretty frustrated by this. If anybody has any tips or pointers they would be very appreciated.

  2. #2
    Just Joined!
    Join Date
    Feb 2005
    Your SQL Server
    i would change the AllowOveride to:

    AllowOverride All

  3. #3
    i would change the AllowOveride to:

    AllowOverride All
    I've already tried that, but thanks anyway.

  4. $spacer_open
  5. #4
    Linux Guru loft306's Avatar
    Join Date
    Oct 2003
    The DairyLand
    umm did you restart the server after the changes to the config's?
    ~Mike ~~~ Forum Rules
    Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. ~ Linus Torvalds

  6. #5
    Quote Originally Posted by loft306
    umm did you restart the server after the changes to the config's?
    Wow. That was it. Thank you so much. You're rad.

  7. #6
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Seattle, Washington
    Nice 404 page makes me hungry.
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts