Forum Moderators: coopster

Message Too Old, No Replies

Browsers not FULLY redirected.?

         

lonewolfonline

8:02 am on Feb 6, 2008 (gmt 0)

10+ Year Member



On one of my sites, a user clicks on a link which calls a script at the root of the domain. This script counts the visit and retrieves the link from the database.

It then sends a 301 Moved header and a header location for the new url (external domain). Most of the time this works absolutely fine.

<?php
..database functions removed...
header("HTTP/1.1 301 Moved Permanently");
header("Location: $url");
?>

In some cases (maybe once per day) a client will click a link, which opens the html of the new page, but the images are attempted to be loaded from my domain. I haven't been able to reproduce this myself, even with several months testing, but in the logs I can see the client hit the go.php?id=343 page, then they request all the images for that page from my site, resulting in a load of 404's.

There does not seem to be any pattern to the user agent, sometimes IE6 others Firefox or IE7

Any Ideas?

Thanks

Regards
Tim

eelixduppy

7:27 pm on Feb 6, 2008 (gmt 0)



Hello and Welcome to WebmasterWorld!

Do you have images in the script after the redirect part? Try adding an exit to the code; something like the following:


header("HTTP/1.1 301 Moved Permanently");
header("Location: $url");
[url=http://www.php.net/exit]exit[/url];

lonewolfonline

8:32 pm on Feb 6, 2008 (gmt 0)

10+ Year Member



I don't have anything after the redirect, but I have added the exit as well. I'll give that a go.
Cheers!

lonewolf