title: if-then-else condition in apache virtual host
body: <p>I have an Apache virtual host defined for <code>https ://sb.domain1.com</code> and I need to do a different action depending on the IP address which calls the virtual host. If the call comes from <code>172.16.xxx.yyy</code> then i need to redirect to <code>http ://sb.domain2.com</code> else i need to redirect to <code>http ://sb.domain1.com</code>.</p>
  
  <p>That is I don't know how to translate the following lines (which come from /etc/http/conf.d/ssl.conf file):</p>
  
  <pre><code>&lt;VirtualHost 192.168.254.68:443&gt;
      ServerName sb.domain1.com
      SSLProxyEngine on
      SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
      SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
      SSLCertificateChainFile /etc/httpd/conf/ssl.crt/STAR.ca-bundle
      SSLEngine on
      SSLSessionCacheTimeout 600
      if IP = 172.16.xxx.yyy
          then 
             Redirect to http ://sb.domain2.com
          else
             ProxyPass / http ://sb.domain1.com/
             ProxyPassReverse / http ://sb.domain1.com/
          else
      ErrorLog "|/usr/sbin/rotatelogs /var/log/httpd/sb/ssl_error_log 86400"
      CustomLog "|/usr/sbin/rotatelogs /var/log/httpd/sb/ssl_access_log 86400" combined
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>can you suggest me translating the above directives?</p>