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 Mark Forums Read
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 04-13-2005, 02:55 PM   #1
nmcog
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/
nmcog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-13-2005, 02:56 PM   #2
nmcog
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]
nmcog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-13-2005, 04:09 PM   #3
Lycanthrope
Confirmed User
 
Lycanthrope's Avatar
 
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)
__________________
Lycanthrope is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-13-2005, 04:22 PM   #4
s9ann0
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]
s9ann0 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-13-2005, 04:29 PM   #5
nmcog
Confirmed User
 
Join Date: Sep 2004
Posts: 825
Thanks Lycanthrope & spanno!
nmcog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-13-2005, 04:31 PM   #6
nmcog
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?
nmcog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-13-2005, 04:35 PM   #7
teksonline
So Fucking Banned
 
Join Date: Jan 2005
Location: At My Desk
Posts: 2,904
wepws double post deleted

Last edited by teksonline; 04-13-2005 at 04:36 PM..
teksonline is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-13-2005, 04:35 PM   #8
teksonline
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]
teksonline 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
Thread Tools



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.