IP Based Redirects using .htaccess?

Discussion in 'Apache' started by melbguy, Mar 21, 2006.

  1. #1
    I would like to redirect any user who logs in from an IP range of 123.123.123.* to be redirected to special.page.html, and have anyone from any other IP range to just view the regular home page.

    Any suggestions on how I can do this in my .htaccess file?

    james
     
    melbguy, Mar 21, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Give this a shot.

    RewriteCond %{REMOTE_ADDR} ^123\.123\.123\.
    RewriteRule ^index\.html$ special.page.html [R=301,L]
    Code (markup):
     
    Slapyo, Mar 22, 2006 IP