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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-18-2006, 04:44 AM   #1
jollyperv
Confirmed User
 
Industry Role:
Join Date: Nov 2001
Location: NYC
Posts: 3,927
.htaccess question...how do you do this?

I want to do a simple redirect from one URL to another, but only want it to redirect if the traffic is coming from 1 particular URL.

Possible with .htaccess?
jollyperv is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 04:55 AM   #2
gooddomains
Too lazy to set a custom title
 
Join Date: Jul 2003
Location: Netherlands
Posts: 10,127
yes, it is, httpd.apache.org is your place to read
gooddomains is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 04:57 AM   #3
TheSwed
Confirmed User
 
TheSwed's Avatar
 
Join Date: Feb 2004
Location: Sweden.
Posts: 3,483
use this tool
http://www.affiliateprogramslocator...._generator.php
TheSwed is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:00 AM   #4
beta-tester
Rock 'n Roll Baby!
 
Join Date: Sep 2004
Location: USA, temporarly
Posts: 22,562
it is possible. Google for answer...
the idea is: test if the site is the one you want traffic redirected if it comes from that site, redirect traffic (301 redirection is the best method).
__________________

Sig for sale. Affordable prices. Contact me and get a great deal ;)

My contact:
ICQ: 944-320-46
e-mail: manca {AT} HotFreeSex4All.com
beta-tester is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:03 AM   #5
jollyperv
Confirmed User
 
Industry Role:
Join Date: Nov 2001
Location: NYC
Posts: 3,927
Thanks guys, been googling around a bit, but trying to word it for a search is tough.
jollyperv is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:05 AM   #6
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
.htaccess
-----------------------
Redirect permanent /old-dir http://www.domain.com/new-dir/
-----------------------

or


.htaccess
-----------------------
Redirect permanent /old-file.html http://www.domain.com/new-file.html
-----------------------
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:06 AM   #7
jollyperv
Confirmed User
 
Industry Role:
Join Date: Nov 2001
Location: NYC
Posts: 3,927
Nah, that's not what I'm trying to do. I want to redirect traffic from only 1 particular URL that is not mine.

Last edited by jollyperv; 10-18-2006 at 05:08 AM..
jollyperv is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:10 AM   #8
tenletters
Confirmed User
 
tenletters's Avatar
 
Join Date: Jan 2001
Location: the deep south
Posts: 2,079
Code:
<script type="text/javascript">
if(document.referrer.indexOf("www.where-traffic-is-coming-from.com") != -1)
{
location.href = "http://www.site-to-send-traffic.com/";
}</script>
it's not htaccess and must be put on each page but it works.
__________________
Useless Without Pics
tenletters is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:13 AM   #9
jollyperv
Confirmed User
 
Industry Role:
Join Date: Nov 2001
Location: NYC
Posts: 3,927
Quote:
Originally Posted by tenletters View Post
Code:
<script type="text/javascript">
if(document.referrer.indexOf("www.where-traffic-is-coming-from.com") != -1)
{
location.href = "http://www.site-to-send-traffic.com/";
}</script>
it's not htaccess and must be put on each page but it works.
Nice, thanks I'll try that
jollyperv is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:15 AM   #10
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
oh right, that'd be........

.htaccess
----------------
RewriteEngine On
rewritecond %{http_host} ^http://(www\.)?target-site\.com
rewriteRule ^(.*) http://www.final-site.com/$1 [R=301,L]
------------------

Should do the trick
where 'target site' is the incoming site
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:16 AM   #11
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by jollyperv View Post
it's not htaccess and must be put on each page but it works.
It's not a 301 redirect. SE traffic is lost, not to mention bunches of non JS users.
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:18 AM   #12
jollyperv
Confirmed User
 
Industry Role:
Join Date: Nov 2001
Location: NYC
Posts: 3,927
Thanks again guys, the javascript thing doesn't seem to be working, gonna try the htaccess.
jollyperv is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:20 AM   #13
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
the right way:

Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.com.*$ [NC]
RewriteRule .* http://www.google.com [R,L]
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:24 AM   #14
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by darksoul View Post
the right way:

Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.com.*$ [NC]
RewriteRule .* http://www.google.com [R,L]
or the perfect way

Quote:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.com.*$ [NC]
rewriteRule .* http://www.final-site.com/ [R=301,L]
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:27 AM   #15
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by quantum-x View Post
or the perfect way
lame.
at least the 3rd time you got it better than your previous failed attempts.
The 301 redirect is meaningless unless its redirecting bot traffic.
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:29 AM   #16
jollyperv
Confirmed User
 
Industry Role:
Join Date: Nov 2001
Location: NYC
Posts: 3,927
Gonna try that latest one, now another question:

What if the incoming URL is a subdomain, and how would I need to change the (www.) part?

You guys rule
jollyperv is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:32 AM   #17
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by darksoul View Post
lame.
at least the 3rd time you got it better than your previous failed attempts.
The 301 redirect is meaningless unless its redirecting bot traffic.
Quoth apache manual:

Quote:
DESCRIPTION: In some cases the same web site is accessible by different addresses, like domain.com, www.domain.com, www.domain2.com and we want to redirect it to one address.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R,L]
fuck man, sorry to use code you don't understand.
cram it.
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:32 AM   #18
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
you can use (.*) instead of www
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:35 AM   #19
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by quantum-x View Post
Quoth apache manual:



fuck man, sorry to use code you don't understand.
cram it.
lol,
you just made a fool out of your self
read again genius, HTTP_HOST is your domain and it will never
match the reffering domain.

do you dig it ? or do I have to draw it for you ?
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:36 AM   #20
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by darksoul View Post
lol,
you just made a fool out of your self
read again genius, HTTP_HOST is your domain and it will never
match the reffering domain.

do you dig it ? or do I have to draw it for you ?

sigh. I just woke up.
Still, you can cram your attitude
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2006, 05:36 AM   #21
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by quantum-x View Post
Quoth apache manual:



fuck man, sorry to use code you don't understand.
cram it.
also the shit you posted redirects ALL referrers instead of one.
you got some comprehension problems.
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
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.