Computing.Net > Forums > Web Development > Custom 404 and $_SERVER['REDIRECT_U

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Custom 404 and $_SERVER['REDIRECT_U

Reply to Message Icon

Name: RTAdams89
Date: December 5, 2007 at 22:02:49 Pacific
OS: na
CPU/Ram: na
Product: na
Comment:

I have my website hosted on a 1and1 Linux host. I am trying to get a custom 404 page working. I have set up Apache (with a .htaccess file) to redirect 404 errors to 404.php. In want the PHP file to show the URL the person tried to go to. I have tried using $_SERVER['REDIRECT_URL'], but this just returns "404.php". How do I show the URL the visitor tried to access before beign redirected to my custom 404 page?

-Ryan Adams
http://ryanadams.blogsite.org



Sponsored Link
Ads by Google

Response Number 1
Name: Laler
Date: December 6, 2007 at 01:49:51 Pacific
Reply:

$_SERVER['REQUEST_URI'] ?


Also use this to list what defined in the array:

<?php

echo '<pre>'.print_r ($_SERVER, true).'</pre>';

?>


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Custom 404 and $_SERVER['REDIRECT_U

My New Custom Computers website www.computing.net/answers/webdevel/my-new-custom-computers-website/420.html

Getting Search Listings Updated www.computing.net/answers/webdevel/getting-search-listings-updated/2780.html

Can't Access Website www.computing.net/answers/webdevel/cant-access-website/3800.html