Forum Moderators: phranque

Message Too Old, No Replies

Host-based redirect in .htaccess

host based redirect in htaccess

         

xyar

10:01 pm on Dec 30, 2005 (gmt 0)



Hi all,

I know a small amount about .htaccess, but have been unable to find the solution to my current problem.

I am the webmaster for my company. I need to make a redirect that only redirects one particular host (one person, actually). I plan on redirecting that host to a mirror image of the site that's slightly different. How do I go about that? I know how to deny based on IP and how to redirect ALL traffic, but how do I redirect based on host/IP?

Thanks in advance!

Ryan

jdMorgan

4:32 am on Dec 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use mod_rewrite, testing %{REMOTE_HOST} or preferably %{REMOTE_ADDR} as a RewriteCond, and then *rewrite* to the ghost copy of your site. Don't do a redirect, since that would reveal the change.

Jim