Conditional rewrite with REMOTE ADDR and "folders"

Discussion in 'Apache' started by Proton, Mar 17, 2010.

  1. #1
    Hi all!

    I am a newbie in apache rewriting so i need some help from you experts on the correct syntax . I have tried to write a psaudocode which hopefully explains what i want:
    If REMOTE_ADDR in 10.47.182.* AND
    ( we try to access ”/” (root) OR ”/folder/” ) then
    Rewrite to https ://www***.mysite.com/folder/file (remark the httpS)

    If REMOTE_ADDR NOT in 10.47.182.* AND
    ( we try to access ”/” (root) OR ”/folder/” ) then
    Rewrite to http ://www***.mysite.int/folder/file

    So i basically want a redirect, and i know that can be done with the [R] option in RewriteRule command
    Anyone that can help me ?
     
    Last edited: Mar 17, 2010
    Proton, Mar 17, 2010 IP