You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ikke Snoeckx <se...@telenet.be> on 2006/08/04 22:28:19 UTC

[users@httpd] RewriteRule

Hello all

I seem to have a weird problem with a RewriteRule...

RewriteCond %{HTTP_USER_AGENT} !^Mozilla/5.* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Opera.*
RewriteRule ^/$ http://www.getfirefox.com [R]

Basically, I want every MSIE to be redirected to getfirefox.com (please 
don't argue or ask why...), so I came up with this RewriteRule (assuming 
MSIE has Mozilla/4.0 as User Agent)...
Problem is, *everyone* gets redirected...
What did I do wrong and what is the solution to this?

Thanks in advance

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] RewriteRule

Posted by Joshua Slive <jo...@slive.ca>.
On 8/4/06, Ikke Snoeckx <se...@telenet.be> wrote:
> Hello all
>
> I seem to have a weird problem with a RewriteRule...
>
> RewriteCond %{HTTP_USER_AGENT} !^Mozilla/5.* [OR]
> RewriteCond %{HTTP_USER_AGENT} !^Opera.*
> RewriteRule ^/$ http://www.getfirefox.com [R]
>
> Basically, I want every MSIE to be redirected to getfirefox.com (please
> don't argue or ask why...), so I came up with this RewriteRule (assuming
> MSIE has Mozilla/4.0 as User Agent)...
> Problem is, *everyone* gets redirected...
> What did I do wrong and what is the solution to this?

Remove the [OR].  All requests are (Not Mozilla) OR (Not Opera).

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org