Forum Moderators: phranque
All the posts regarding redirection by ip I've found so far have been just allow/deny.. I want to allow everyone, but send them to different places. I hope this makes sense..
Welcome to WebmasterWorld!
There is a module for Apache called mod_rewrite which would work perfectly for this. Most hosts running Apache have it installed by default. If you are not familiar with .htaccess files or mod_rewrite, there are some links in this forum's charter which can get you started.
It sounds like what you want to do is try to match a certain set of IP addresses to one image, and everyone else to a different image. If you put the following in an .htaccess file, it should do the trick for you:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REMOTE_HOST} ^123\.234\.231\.
RewriteRule ^images/kitten\.gif /images/puppy.gif [L]
RewriteRule ^images/kitten\.gif /images/wombat.gif [L] Essentially what this is doing is comparing the user's IP address against a pattern (in this case, anyone with an addresses starting with 123.234.231), and if it matches, executes the first RewriteRule. If it does not match, then the send rule is executed.
Chad
[edited by: jdMorgan at 12:42 am (utc) on Aug. 10, 2005]
[edit reason] Fixed [ code] formatting. [/edit]