.htaccess, 301 redirects, and Directing domains

tenix

Newbie
Joined
Aug 23, 2011
Messages
43
Reaction score
0
I'm looking for a way to direct visitors to a site, then another site and a third site, but only when it's coming from the first site.

For example, I send visitors to:
DomainA.com/test, which then redirects to
DomainB.com/test, which then redirects to
yahuu.com/test

If a user goes to DomainB.com/test they see a normal webpage, but when they are forwarded by DomainA.com/test they are instantly sent to yahuu.com/test

Is that possible?
 
I doubt it my man...
 
Cant you just have the traffic from the first domain forward directly to thethird domain?
 
Yes it's possible with something like this - not tested this piece of code.

<?php if (preg_match("www\.domaincheck\.com", $_SERVER['HTTP_REFERER'])) {
header("Location: http://whereyouwanttoredirect.com"); exit(); }

//normal code here


?>
 
I'm looking for a way to direct visitors to a site, then another site and a third site, but only when it's coming from the first site.

For example, I send visitors to:
DomainA.com/test, which then redirects to
DomainB.com/test, which then redirects to
yahuu.com/test

If a user goes to DomainB.com/test they see a normal webpage, but when they are forwarded by DomainA.com/test they are instantly sent to yahuu.com/test

Is that possible?

Wouldn't a 301 redirect from DomainA directly to yahuu, and no redirect at all for DomainB be better ... actually the only way to do that?
 
Wouldn't a 301 redirect from DomainA directly to yahuu, and no redirect at all for DomainB be better ... actually the only way to do that?

There's sometimes need to do it this way ;)

And no, it's not the only way.
 
Wouldn't a 301 redirect from DomainA directly to yahuu, and no redirect at all for DomainB be better ... actually the only way to do that?

Right, if I do a 301 from DomainA to DomainB and a 301 from DomainB to yahuu that would work, but any visitor that went to DomainB would also be 301 redirected, I only want people who came from DomainA
 
Using PHP to match the referrer like domainmadness suggested is the only way I can think of doing it. If you explain why you're doing this, you could get a bit better answers though ;)
 
Back
Top