I am trying to write a simple rewrite rule using the rewriteengine in apache. I want to redirect all traffic destined to a website unless the traffic originates from a specific IP address and the URI contains two specific strings.
RewriteEngine On
RewriteLog /var/log/apache2/rewrite_kudithipudi.log
RewriteLogLevel 1
RewriteCond %{REMOTE_ADDR} ^199\.27\.130\.105
RewriteCond %{REQUEST_URI} !/StringOne [NC, OR]
RewriteCond %{REQUEST_URI} !/StringTwo [NC]
RewriteRule ^/(.*) http://www.google.com [R=302,L]
I put these statements in my virtual host configuration. But the rewriteengine seems to be redirect all requests, whether they match the condition or not. Am I missing something? Thank you.
- Vinay.