Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP redirect - can this be done?
Old 11-15-2010, 11:18 PM PHP redirect - can this be done?
TWD
TWD's Avatar
King Spam Talker

Posts: 1,190
Trades: 0
Website A has a link pointing to Website C

Website B has the same link pointing to Website C



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
TWD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-15-2010, 11:32 PM Re: PHP redirect - can this be done?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-18-2010, 07:56 PM Re: PHP redirect - can this be done?
Junior Talker

Posts: 1
Name: Jack
Trades: 0
PHP redirection.Have a look at this tips
enjoy0309r is offline
Reply With Quote
View Public Profile
 
Old 11-19-2010, 04:50 AM Re: PHP redirect - can this be done?
hhunt's Avatar
Average Talker

Posts: 15
Name: Helen
Trades: 0
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

Please login or register to view this content. Registration is FREE
hhunt is offline
Reply With Quote
View Public Profile Visit hhunt's homepage!
 
Old 11-22-2010, 04:03 AM Re: PHP redirect - can this be done?
Banned

Posts: 408
Name: mushget
Trades: 0
I have used $_SERVER['HTTP_REFERRER'], it works not well, sometime it has a wrong value. or null.
mushget is offline
Reply With Quote
View Public Profile Visit mushget's homepage!
 
Old 11-22-2010, 07:10 AM Re: PHP redirect - can this be done?
Novice Talker

Posts: 2
Name: Rakesh
Trades: 0
There is not option for redirect in PHP , you have to use header function for this
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
babpavel16 is offline
Reply With Quote
View Public Profile
 
Old 11-25-2010, 06:33 AM Re: PHP redirect - can this be done?
Extreme Talker

Posts: 156
Trades: 0
This can be done relatively easily from the .htaccess file
dagaul101 is offline
Reply With Quote
View Public Profile
 
Old 11-25-2010, 06:49 AM Re: PHP redirect - can this be done?
TWD
TWD's Avatar
King Spam Talker

Posts: 1,190
Trades: 0
Quote:
Originally Posted by dagaul101 View Post
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
TWD is offline
Reply With Quote
View Public Profile
 
Old 11-25-2010, 08:09 AM Re: PHP redirect - can this be done?
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Quote:
Originally Posted by TWD View Post
Care to elaborate.....?
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!
PaulW is offline
Reply With Quote
View Public Profile
 
Old 11-25-2010, 07:28 PM Re: PHP redirect - can this be done?
TWD
TWD's Avatar
King Spam Talker

Posts: 1,190
Trades: 0
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
TWD is offline
Reply With Quote
View Public Profile
 
Old 11-25-2010, 07:54 PM Re: PHP redirect - can this be done?
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
.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.
PaulW is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP redirect - can this be done?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.97977 seconds with 12 queries