|
|
|
||||
|
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. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
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? |
|
|
|
|
|
#2 |
|
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
|
|
|
|
|
|
#3 |
|
Confirmed User
Join Date: Feb 2004
Location: Sweden.
Posts: 3,483
|
use this tool
http://www.affiliateprogramslocator...._generator.php |
|
|
|
|
|
#4 |
|
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 |
|
|
|
|
|
#5 |
|
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.
|
|
|
|
|
|
#6 |
|
Confirmed User
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 ----------------------- |
|
|
|
|
|
#7 |
|
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.
|
|
|
|
|
|
#8 |
|
Confirmed User
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>
|
|
|
|
|
|
#9 | |
|
Confirmed User
Industry Role:
Join Date: Nov 2001
Location: NYC
Posts: 3,927
|
Quote:
|
|
|
|
|
|
|
#10 |
|
Confirmed User
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 |
|
|
|
|
|
#11 |
|
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
It's not a 301 redirect. SE traffic is lost, not to mention bunches of non JS users.
|
|
|
|
|
|
#12 |
|
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.
|
|
|
|
|
|
#13 |
|
Confirmed User
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]
|
|
|
|
|
|
#14 | ||
|
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
Quote:
Quote:
|
||
|
|
|
|
|
#15 |
|
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
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. |
|
|
|
|
|
#17 | ||
|
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
Quote:
Quote:
cram it. |
||
|
|
|
|
|
#19 | |
|
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
Quote:
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 ? |
|
|
|
|
|
|
#20 | |
|
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
Quote:
sigh. I just woke up. Still, you can cram your attitude |
|
|
|
|
|
|
#21 | |
|
Confirmed User
Join Date: Apr 2002
Location: /root/
Posts: 4,997
|
Quote:
you got some comprehension problems. |
|
|
|
|