![]() |
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? |
$25 paypal for it
|
icq me :)
|
Just use htaccess
RewriteEngine on RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?gfy.com.*$ [NC] RewriteRule .* http://www.lemonparty.org [R,L] |
Quote:
don't use icq my aim is willraim though |
Quote:
|
Quote:
|
I have the code somewhere, let me see if I can dig it up.
|
why would you waste it with javascript when htaccess can do it without editing any code on your site, seems silly
|
<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 |
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> |
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:
|
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