I want to redirect those visitors coming to Website C (my website) who come VIA Website A on to Website D
BUT NOT visitors who come VIA Website B (or any other source really).
Is there a PHP function that would help out here?
__________________ RATE-MY-WEBSITE.com "Free website reviews by real web professionals" Please login or register to view this content. Registration is FREE
You can use $_SERVER['HTTP_REFERRER'] to determine where the user is coming from. There is no guarantee however, that the referrer will be set. I wouldn't rely on it for anything important.
You could use $_SERVER['HTTP_REFERRER'], but as nullPointer mentioned above, you can't rely on it for something important. Another thing you could do might be to add an interfacing page that has a token. So, point site A to interfacing page (with token) and use that token to determine that they came from site A.
Not sure if that makes any sense
__________________
A top-class Please login or register to view this content. Registration is FREE that won't rifle through your photos Honest Please login or register to view this content. Registration is FREE lesson Cheap Please login or register to view this content. Registration is FREE
This can be done relatively easily from the .htaccess file
Care to elaborate.....?
__________________ RATE-MY-WEBSITE.com "Free website reviews by real web professionals" Please login or register to view this content. Registration is FREE
Create a file names ".htaccess" in the root directory and add RewriteCond and RewriteRules. Do a search for .htaccess rewrite conditions for full info.I'd recommend that you try this in a lower level directory first!
I'm well aware of using 301 redirects.
But I'm not convinced that .htaccess files can determine the origin of incoming
links. And even if they could, how to set up conditional logic on a page by page basis.
__________________ RATE-MY-WEBSITE.com "Free website reviews by real web professionals" Please login or register to view this content. Registration is FREE
.htaccess (ie mod_rewrite) allows multiple rewrite conditions to rules, and you can combine check on HTTP_REFERRER with check on REQUEST_URI See http://corz.org/serv/tricks/htaccess2.php for a very comprehensive set of examples.