Forum Moderators: phranque

Message Too Old, No Replies

ip address redirects

ip to domain

         

eveningwalk

10:21 am on Aug 9, 2005 (gmt 0)

10+ Year Member



Google has indexed my site bt IP address - so I get Google referrers who enter my site by IP address. How do I redirect them to my site (by name). For ex: if I need to redirect from IP address 11.222.33.444/*.* to example.com/*.*, how do I do that? I tried adding

Redirect 11.222.33.444 example.com

but this did not work. Any help would be appreciated.

TIA,
eveningwalk

jdMorgan

1:00 am on Aug 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using Apache mod_rewrite [httpd.apache.org], this is easy to do:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^11\.222\.33\.444
RewriteRule (.*) http://example.com/$1 [R=301,L]

Jim

eveningwalk

4:03 am on Aug 13, 2005 (gmt 0)

10+ Year Member



Thanks jd - I need to visit the forum more often!

eveningwalk