![]() |
.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? |
yes, it is, httpd.apache.org is your place to read
|
use this tool
http://www.affiliateprogramslocator...._generator.php |
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). |
Thanks guys, been googling around a bit, but trying to word it for a search is tough.
|
.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 ----------------------- |
Nah, that's not what I'm trying to do. I want to redirect traffic from only 1 particular URL that is not mine.
|
Code:
<script type="text/javascript"> |
Quote:
|
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 |
Quote:
|
Thanks again guys, the javascript thing doesn't seem to be working, gonna try the htaccess.
|
the right way:
Code:
RewriteEngine On |
Quote:
Quote:
|
Quote:
at least the 3rd time you got it better than your previous failed attempts. The 301 redirect is meaningless unless its redirecting bot traffic. |
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 :thumbsup |
Quote:
Quote:
cram it. |
you can use (.*) instead of www
|
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 ? |
Quote:
sigh. I just woke up. Still, you can cram your attitude :) |
Quote:
you got some comprehension problems. |
| All times are GMT -7. The time now is 07:26 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123