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.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 04-14-2014, 04:33 PM   #1
CPA-Rush
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
CPA-Rush is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-14-2014, 06:09 PM   #2
Tdash
Confirmed User
 
Tdash's Avatar
 
Industry Role:
Join Date: May 2013
Posts: 683
Javascript? It can easily be done in php.
Tdash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-15-2014, 03:21 AM   #3
CPA-Rush
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
CPA-Rush is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-15-2014, 03:18 PM   #4
sarettah
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!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-15-2014, 03:40 PM   #5
CPA-Rush
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
CPA-Rush is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-16-2014, 03:21 AM   #6
CPA-Rush
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:
Browsers do not always provide a document.referrer. If the referrer is from a https it is blocked, or if the security settings in the broswer block it none is provided. These people will never get past the page and will be cut off from being able to use your site
they will go to http://www.google.com , right ?
__________________

automatic exchange - paxum , bitcoin,pm, payza

. daizzzy signbucks caution will black-hat black-hat your traffic

ignored forever :zuzana designs
CPA-Rush is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-16-2014, 07:00 AM   #7
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,053
Quote:
Originally Posted by rosx View Post
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';
}
Well, it appears to me that you will never send anyone to msn.com with that.

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!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-16-2014, 07:16 AM   #8
CPA-Rush
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:
Originally Posted by sarettah View Post
Well, it appears to me that you will never send anyone to msn.com with that.

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.

.


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

Last edited by CPA-Rush; 04-16-2014 at 07:18 AM..
CPA-Rush is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-30-2014, 05:15 AM   #9
Kafka
Confirmed User
 
Kafka's Avatar
 
Join Date: Oct 2002
Location: Holland
Posts: 466
I suggest you should use ModRewrite (htaccess) with that.
Kafka is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 04-30-2014, 08:47 PM   #10
CPA-Rush
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:
Originally Posted by Kafka View Post
I suggest you should use ModRewrite (htaccess) with that.
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
CPA-Rush is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.