I created a .htaccess page that has

ErrorDocument 404 [url]http://www.mysite.com/404.php[/url]

However that will not work on my hosted site, they have both Apache and have PHP, but for whatever reason whenever I use that it then makes every page show up blank, even pages that were valid.

Yes, I do actually have a file called 404.php that gives some info about "you put in the wrong address/page moved...".

I'm not sure why its not working, maybe its the way they have the server setup I cant figure it out. I can put up some of my phpinfo() if you need me to

Please help 😕 thanks

    I think its a server configuration issue, but im not that great with Server configuration so dont take my word for it.

    I tried a similar thing and had it not work changed it to .html extension and instead of directly using it

    ErrorDocument 404 /404.html

    worked. However i added .html to be parsed as PHP as well.

      I tried that and got in Internal Error

      Yeh I think it is the way they have their server configured, I emailed them about it but they wont help me with the 404 page, but I have the phpinfo() if anyone does know about Apache 😕

        phpinfo() tells you about PHP, not your web server, except where it happens to do so because it is related to PHP.

        Are you even allowed to use .htaccess files?

          Have you tried just:

          ErrorDocument 404 /404.php

          ?

            Yes, I had already tried that as someone mentioned, I got:

            Internal Server Error
            The server encountered an internal error or misconfiguration and was unable to complete your request 🙁

              OK; is your server running Apache with mod_php, or is PHP running as a CGI in the /cgi-bin directory? (Some hosts like to do it that way, for reasons that are a mystery to me*).

              *albeit, one I've not been curious enough to worry about researching...

                Loaded Modules: mod_php4, mod_setenvif, mod_auth, mod_access, mod_alias, mod_userdir, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_status, mod_negotiation, mod_mime, mod_log_config, mod_env, http_core

                Although it is running PHP in the CGI-BIN directory 😕

                  If your php scripts are run from the cgi-bin directory, it might explain the "Internal Server Error" messages that you refer to.

                  httpd.conf suggests "ErrorDocument 404 /cgi-bin/missing_handler.pl" in the comments; is it possible to put your 404 page in that dir and try again? I don't use cgi-bin for PHP scripts, so I don't know if it'll make one bit of difference... 🙁

                  It may not be possible to override that setting ... I don't know that either, though.

                    Write a Reply...