Results 1 to 2 of 2

Thread: .htaccess ErrorDocument only partially loading (php doc)

  1. #1
    Registered
    Join Date
    Sep 2002
    Posts
    13
    Rep Power
    0

    .htaccess ErrorDocument only partially loading (php doc)

    I've been getting a lot of 404 errors in my logs recently. I wanted to investigate, and discovered that I wasn't logging the bad URLs because in my .htaccess file, when I set the ErrorDocument, I used a complete address rather than a relative address. So I changed it to:

    Code:
    ErrorDocument 404 /404.php
    But now, it's the weirdest thing. When I type in a bad URL intentionally, I get served PART of the custom 404.php doc. Like the last 20 some odd lines of source code, out of 195. And it's not always exactly the same, sometimes it loads a few more lines of the code, sometimes less. I can make a change to the end of my file, reload, and see that I am in fact getting served the file I think I am. It's a php file, with several includes to headers, footers, etc. I know the php is working because the last bit of the code is all from an included file.

    So I tried making a completely different error doc, with no includes, just a few lines long, and put it in the same directory as the original 404.php, in /htdocs. Changed the .htaccess to point at it (relative) and instead of partially loading like the other 404, it shows me a google "oops, this link appears to be broken" page rather than the new file. If I put the full link in the .htdoc (http://etc) however, it pulls up just fine upon loading a bad URL, though again, I have no bad URL referrer/info to help me track down problems.

    I am mightily confused.

    I'm going to switch it back so as not to freak genuinely lost visitors out, but any ideas about what could be going on, and/or how to get those bad URL refs in some other way would be GREATLY appreciated.

    Thanks!
    Victoria

  2. #2
    Mod.. with bite.. Croc Hunter's Avatar
    Join Date
    Sep 2002
    Location
    Australia
    Posts
    7,332
    Rep Power
    26
    It sounds like your cache needs a good cleanout. What did you make the files with? Notepad can be glitchy with php, Notepad++ will avoid that possibility.
    Croc Hunter MSC :

Posting Permissions

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