title: .htaccess redirect for multiple IP ranges
body: <p>I am trying to redirect multiple different IP addresses except those that match a specific user-agent. So far I've been able to successfully do this with 1 IP range, eg:</p>
  
  <pre><code>RewriteCond %{REMOTE_ADDR} ^123\.123\.123\.[0-9]{1,3}$
  RewriteCond %{HTTP_USER_AGENT} !^useragent$
  RewriteRule ^(.*)$ http://www.redirecthere.com/$1 [L]
  </code></pre>
  
  <p>So the above redirects the IPs 123.123.123.x to the URL - unless that IP has this useragent, in which case no redirect takes place. </p>
  
  <p>I actually need  to redirect several other IP ranges as well as this. But doing so as follows breaks everything:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{REMOTE_ADDR} ^123\.123\.123\.[0-9]{1,3}$
  RewriteCond %{REMOTE_ADDR} ^124\.124\.124\.[0-9]{1,3}$
  RewriteCond %{HTTP_USER_AGENT} !^useragent$
  RewriteRule ^(.*)$ http://www.redirecthere.com/$1 [L]
  </code></pre>
  
  <p>What am I doing wrong? I wasn't able to find any duplicate questions. </p>