Redirection question

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

Edd224
New php-forum User
New php-forum User
Posts: 3
Joined: Tue Jan 04, 2005 5:26 pm

Redirection question

Postby Edd224 » Tue Jan 04, 2005 5:36 pm

Yahoo only supports custom 404 pages if you name them e404.html but my website is in php.

I wanted a way to automatically submit to the e404.php page the bad link, and the refering page (if available).

The only way I could figure out how to do this was using REDIRECT_URL and HTTP_REFERER in the meta tag.

Code: Select all

<meta http-equiv="refresh" content="0;
url=/e404.php?request=<!--#echo var="REDIRECT_URL" -->&refer=<!--#echo var="HTTP_REFERER" -->">


There must be a better way that this.

It leads to a second problem in the following hp page when I use the $_GET['refer'] to pull the referring page down.

If the link hosting site is google or yahoo with a bad link (which it invariabley is then $_GET['refer'] contains all sorts of punctuation that stops the script.

So the script can't send an email me telling me which links are out of date and where those links are hosted.

This is only a problem when linking from google and yahoo but hopefully can be overcome

Code: Select all

   $message = "
            ."  Page:\r\n  http://www.{$_SERVER['SERVER_NAME']}{$_GET['request']}\r\n"
            ."  Referring Page: {$_GET['refer']}\r\n"


help would be nice

thanks
edd

Edd224
New php-forum User
New php-forum User
Posts: 3
Joined: Tue Jan 04, 2005 5:26 pm

Postby Edd224 » Tue Jan 04, 2005 6:48 pm

an example of the google output is:

Code: Select all

http://www.google.com/search?q=+our+website&sourceid=mozilla-search
&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official


Return to “HTML Basics”

Who is online

Users browsing this forum: No registered users and 1 guest

cron