views:

13

answers:

1

I have a fairly simple redirect rule setup in my Apache vhost.

<VirtualHost *:80>
    ServerName mobile.foo.com
    ServerAlias *.foo.com

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(.*)\.foo\.com$
    RewriteRule ^(.*)$ http://mobile.bar.com/foo [R=301,L]
</VirtualHost>

I want to add another condition based on the request uri. The redirect above should not be performed if the request uri equals "google.html". I guess another rewrite condition is needed based on the request uri variable. Any ideas on how the regex should look like?

Thanks in advantage!

A: 

Should look like this:

RewriteCond %{REQUEST_URI} !^/google\.html$
unbeli
Thanks! Works like a charm!
mptre