Nub Question On Redirecting

Status
Not open for further replies.

ifwearner

New member
Feb 22, 2008
33
0
0
Hey I was wondering the simple way to make a site redirect to another site if it isn't being viewed through the first site.

Example:
SiteA redirects to SiteB. If SiteB isn't being viewed through the 301 redirect from SiteA, it will redirect to SiteA's domain.

Thanks
 


Example:
SiteA redirects to SiteB. If SiteB isn't being viewed through the 301 redirect from SiteA, it will redirect to SiteA's domain.
On Site B check the $_SERVER['HTTP_REFERER'] variable to see if the visitor is coming from Site A. If not, send them back to Site A. This won't work however if you're immediately redirecting them once they hit Site A (unless it's a metarefresh). In that case the referrer will show as being whatever site sent them to Site A, which is probably not what you want.
 
Status
Not open for further replies.