Jump to content
xisto Community
Shawn

Custom 404 Error Pages A Tutorial On How To Make Custom 404 Error Pages

Recommended Posts

That will work for .htm .html .php .asp .mp3 .jpg ... Any file can be called as an error page (as far as I am aware).

It won't look for /subdir/404.php if you put the .htaccess in the /public_html/ folder directly. This will apply your error page to all sub folders, but won't include the sub folder name in the search for the file.

The user's IP can be taken with the following line of code:

$ip = $_SERVER['REMOTE_ADDR'];

You can resolve that IP address with the following code (in place of what is above):

$resolve = GetHostByName($_SERVER['REMOTE_ADDR']);

To get the page that the user came from you can use the code:

$referrer = $_SERVER['HTTP_REFERER'];/* That can sometimes fail as some browsers stop it being sent, so you could try this if it doesn't work */$referrer_uri = $_SERVER['REQUEST_URI'];

I don't think it is possible to find out what page a user was going to, as it will be changed to your 404.php anyway.

I hope this helps you.

Share this post


Link to post
Share on other sites

What is 404 error and I need help fixing it?

Custom 404 Error Pages

 

I am trying to download the new yahoo instant messenger. I can get almost the whole thing to download when all the sudden I get "404 not found". What the heck is this?

 

I never got the error when I downloaded on Windows Millennium. Now I have windows XP and having problems. I am not any computer guru so if someone could talk me through this with very clear and easy instructions it would be greatly appreciated.

 

-denise

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.