![]() |
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/ |
I've tried this code but it doesn't seem to work:
Code:
RewriteEngine on |
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) |
try this for the no-referer:
RewriteCond %{HTTP_REFERER} ="" RewriteRule (.*) http://www.mydomain.com/index-bookmark.html [R=permanent,L] |
Thanks Lycanthrope & spanno! :thumbsup
|
Is it possible to get it to show http://www.mydomain.com/ in the browser but really show the contents of index-abc.html?
|
wepws double post deleted
|
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