GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   mod_rewrite question (https://gfy.com/showthread.php?t=455566)

nmcog 04-13-2005 02:55 PM

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 04-13-2005 02:56 PM

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]


Lycanthrope 04-13-2005 04:09 PM

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)

s9ann0 04-13-2005 04:22 PM

try this for the no-referer:


RewriteCond %{HTTP_REFERER} =""
RewriteRule (.*) http://www.mydomain.com/index-bookmark.html [R=permanent,L]

nmcog 04-13-2005 04:29 PM

Thanks Lycanthrope & spanno! :thumbsup

nmcog 04-13-2005 04:31 PM

Is it possible to get it to show http://www.mydomain.com/ in the browser but really show the contents of index-abc.html?

teksonline 04-13-2005 04:35 PM

wepws double post deleted

teksonline 04-13-2005 04:35 PM

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]


All times are GMT -7. The time now is 07:22 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123