![]() |
![]() |
![]() |
||||
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
Join Date: Sep 2004
Posts: 825
|
mod_rewrite question
What I'm trying to do:
Display different different pages depending on the domain in HTTP Refer Example: 1) Traffic from abc.com gets redirected to http://www.mydomain.com/index-abc.html 2) Traffic from xyz.com gets redirected to http://www.mydomain.com/index-zyx.html 3) Traffic from no referer (bookmark) gets redirected to http://www.mydomain.com/index-bookmark.html Also, the redirection should be invisible, i.e. the page contents will be of a different page but it will show as http://www.mydomain.com/ |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Sep 2004
Posts: 825
|
I've tried this code but it doesn't seem to work:
Code:
RewriteEngine on RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?abc.com.*$ [NC] RewriteRule (.*) http://www.mydomain.com/index-abc.html [R=permanent,L] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Wisconsin
Posts: 4,517
|
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?abc.com.*$ [NC] RewriteRule (.*) http://www.mydomain.com/index-abc.html [R=permanent,L] take out the exclamation point before ^http... Right now you are telling your server to redirect everyone that ISN'T from that domain to the page you meant for that domain. (!=NOT) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Sep 2001
Location: Boston
Posts: 4,873
|
try this for the no-referer:
RewriteCond %{HTTP_REFERER} ="" RewriteRule (.*) http://www.mydomain.com/index-bookmark.html [R=permanent,L] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Sep 2004
Posts: 825
|
Thanks Lycanthrope & spanno!
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Sep 2004
Posts: 825
|
Is it possible to get it to show http://www.mydomain.com/ in the browser but really show the contents of index-abc.html?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
So Fucking Banned
Join Date: Jan 2005
Location: At My Desk
Posts: 2,904
|
wepws double post deleted
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
So Fucking Banned
Join Date: Jan 2005
Location: At My Desk
Posts: 2,904
|
yes, not gonna sit down and figure it out for you as im busy but
play with this line... RewriteRule ^index.html /index-abc.html [QSA,L] |
![]() |
![]() ![]() ![]() ![]() ![]() |