Can PHP do this

Joined: 11/28/2008

Hi

Having moved my site from a subdomain of gospelcom (ied.gospelcom) to its own domain http://www.internetevangelismday.com there are permanent 301 redirects from ied.gospelcom.net to the new domain, for each page.

If I use PHP to find the referrer to any age, it displays the correct original linking page, irrespective of whether it was linking to ied.gospelcom.net or the new domain.

Is there any sort of page property that PHP can detect, that would show the page had been a redirect from the subdomain, rather than a direct link?

blessings and thanks

Tony

Online outreach:
Internet Evangelism Day
Helping church websites:
Church Websites

Joined: 11/28/2008
$_SERVER['HTTP_REFERER']

What you're looking for is $_SERVER['HTTP_REFERER']. This will tell you where the user has come from, however, it is based on clicked links, and if I'm not mistaken, script redirects, as opposed to a 301 redirect at the server level (Apache). I'm not sure how else you would be able to track this.

Who can bring a charge to God's elect? It is God who justifies!

Joined: 11/28/2008
thanks

Thanks - yes, HTTP_REFERER shows up the real referrer, so there's not much I can do. It was just an idea!

blessings and thanks

Tony

Online outreach:
Internet Evangelism Day
Helping church websites:
Church Websites

Joined: 12/20/2008
For your 301 redirects, if

For your 301 redirects, if you are using an .htaccess file , can you append an extra url parameter? Like '&source=subdomain'. Then read the variable from your php file. Not too elegant, but might work.

Jim