![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
Thread Tools |
![]() |
#1 |
small trip to underworld
Industry Role:
Join Date: Mar 2012
Location: first gen intel 80386/nintendo-gb/arcade/ps1/internet person
Posts: 4,927
|
javascript
i need to redirect based on referrer
for example #if source www.site.com/folder/0123 >> go link1 or ##if source www.site.com/folder/4567 >> go link 2 or ##if source www.site.com/folder/89xx >> go link3 else , in case the user doesn?t sent his referrer or come from any other source >> just go link4 PS: my current redirect script is .js file not inside html file thanks
__________________
automatic exchange - paxum , bitcoin,pm, payza . daizzzy signbucks caution will black-hat black-hat your traffic ignored forever :zuzana designs
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: May 2013
Posts: 683
|
Javascript? It can easily be done in php.
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#3 |
small trip to underworld
Industry Role:
Join Date: Mar 2012
Location: first gen intel 80386/nintendo-gb/arcade/ps1/internet person
Posts: 4,927
|
the reason i prefer javascript because i will be able to see stats via analytic
php execute faster than anything else ![]()
__________________
automatic exchange - paxum , bitcoin,pm, payza . daizzzy signbucks caution will black-hat black-hat your traffic ignored forever :zuzana designs
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#4 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,053
|
Simple version:
<script type="text/javascript"> if(document.referrer=='http://www.site.com/folder/0123') { window.location='http://whatever_url_1.com '; } else if(document.referrer=='http://www.site.com/folder/4567') { window.location='http://whatever_url_2.com '; } else if(document.referrer=='http://www.site.com/folder/89xx') { window.location='http://whatever_url_3.com '; } else { window.location='http://whatever_url_4.com '; } </script>
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#5 |
small trip to underworld
Industry Role:
Join Date: Mar 2012
Location: first gen intel 80386/nintendo-gb/arcade/ps1/internet person
Posts: 4,927
|
thanks sarettah i will try this code +1
![]()
__________________
automatic exchange - paxum , bitcoin,pm, payza . daizzzy signbucks caution will black-hat black-hat your traffic ignored forever :zuzana designs
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#6 | |
small trip to underworld
Industry Role:
Join Date: Mar 2012
Location: first gen intel 80386/nintendo-gb/arcade/ps1/internet person
Posts: 4,927
|
sarettah this worked with me just after doing little change
Code:
if (document.referrer.indexOf('https://gfy.com/') > -1) { window.location='http://yahoo.com'; } else if (document.referrer.indexOf('https://gfy.com/forum') > -1) { window.location='http://msn.com'; } else { window.location='http://www.google.com'; } ![]() thanks Quote:
__________________
automatic exchange - paxum , bitcoin,pm, payza . daizzzy signbucks caution will black-hat black-hat your traffic ignored forever :zuzana designs
|
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#7 | |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,053
|
Quote:
Your first condition document.referrer.indexOf('https://gfy.com/') > -1 should send anyone from gfy to yahoo. Since the second condition also includes the first condition it will never be hit. So, if you wanted to do that switch condition 1 and 2 around. Make condition 1 be gfy.com/forum and condition 2 be just gfy. That way the ones to the forums will be redirected to msn and then anyone else from gfy will be redirected to yahoo. I had done the exact match conditions because you had included specific pages in your example. As I said, it was a very simple version. Glad it worked for you. .
__________________
All cookies cleared! |
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#8 | |
small trip to underworld
Industry Role:
Join Date: Mar 2012
Location: first gen intel 80386/nintendo-gb/arcade/ps1/internet person
Posts: 4,927
|
Quote:
![]() i will correct that and remove that switch " > -1)" tnx for the heads up , cheers ![]()
__________________
automatic exchange - paxum , bitcoin,pm, payza . daizzzy signbucks caution will black-hat black-hat your traffic ignored forever :zuzana designs
|
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Oct 2002
Location: Holland
Posts: 466
|
I suggest you should use ModRewrite (htaccess) with that.
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#10 |
small trip to underworld
Industry Role:
Join Date: Mar 2012
Location: first gen intel 80386/nintendo-gb/arcade/ps1/internet person
Posts: 4,927
|
i need to keep the analytics stats
![]()
__________________
automatic exchange - paxum , bitcoin,pm, payza . daizzzy signbucks caution will black-hat black-hat your traffic ignored forever :zuzana designs
|
![]() |
![]() ![]() ![]() ![]() |