Setting an evironment variable

Discussion in 'Apache' started by Michau, Apr 7, 2006.

  1. #1
    I am trying to do a simple thing. Or at least I thought it is simple. I need to set up a .htaccess rule which sets an Apache environment variable to first three elements of visitor IP address. So, when REMOTE_ADDR is 12.34.56.78, i need my variable to be 12.34.56

    I tried mod_rewrite, but it operates only on URLs. I tried SetEnvIf, with bad luck either. How do I do this?
     
    Michau, Apr 7, 2006 IP