GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   java redirect? (https://gfy.com/showthread.php?t=894476)

ztik 03-18-2009 01:05 PM

java redirect?
 
Anyone know how to redirect from a certain referral url in java script?

Say someone is linking to my site from gfy.com I want all the people who click from there to goto lemonparty.org

Anyone know how?

ztik 03-18-2009 02:01 PM

$25 paypal for it

u-Bob 03-18-2009 02:07 PM

icq me :)

Sam Granger 03-18-2009 02:14 PM

Just use htaccess

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?gfy.com.*$ [NC]
RewriteRule .* http://www.lemonparty.org [R,L]

ztik 03-18-2009 03:19 PM

Quote:

Originally Posted by u-Bob (Post 15645038)
icq me :)


don't use icq my aim is willraim though

ztik 03-18-2009 03:22 PM

Quote:

Originally Posted by Sam Granger (Post 15645073)
Just use htaccess

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?gfy.com.*$ [NC]
RewriteRule .* http://www.lemonparty.org [R,L]

looking for java :(

xentech 03-18-2009 03:36 PM

Quote:

Originally Posted by ztik (Post 15645423)
looking for java :(

Why, are you going to put it on somebody else's site? :)

st0ned 03-18-2009 03:38 PM

I have the code somewhere, let me see if I can dig it up.

fris 03-18-2009 03:52 PM

why would you waste it with javascript when htaccess can do it without editing any code on your site, seems silly

Sam Granger 03-18-2009 04:16 PM

<script>
if((/^https?\:\/\/(www\.)?gfy\.com/).test(document.referrer)){
location.href="http://www.lemonparty.org";
}
</script>

Please send payment to [email protected]

Place the script in your header

Sam Granger 03-18-2009 04:17 PM

So, something like this:

<html>
<head>
<title>Title goes here</title>
<script>
if((/^https?\:\/\/(www\.)?kwackin\.com/).test(document.referrer)){
location.href="http://www.google.com";
}
</script>
</head>
<body>
GFY'ers love lemonparty
</body>
</html>

borked 03-18-2009 04:34 PM

I think he wants all the links to change, not an auto-redirect.
Could be wrong though


btw, in your regex, no need to escape the colon \:

Quote:

Originally Posted by Sam Granger (Post 15645707)
<script>
if((/^https?\:\/\/(www\.)?gfy\.com/).test(document.referrer)){
location.href="http://www.lemonparty.org";
}
</script>

Please send payment to [email protected]

Place the script in your header


ztik 03-18-2009 04:35 PM

worked :)

payment sent


All times are GMT -7. The time now is 03:12 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123