Hi, Chris-
This should redirect to /bad-browser.shtml:
RewriteCond %{HTTP_USER_AGENT} Firefox/
RewriteCond %{HTTP_USER_AGENT}
!Firefox/(3\.0\.19|3\.5\.9|3\.6\.3)($|[^\.0-9])
RewriteRule .* /bad-browser.shtml [R=307,L]
Looks just about like what you already had though.
I'm not sure the substitution is applied with F(orbidden).
-Terence Bandoian
Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
All,
Slightly off-topic, but relevant.
On our development servers, I'm trying to enforce a rule that all our
users have the most up-to-date web browser available (yeah, it's an
uphill battle, I know... just go with it).
I decided to use mod_rewrite to check for a User-Agent pattern and then
forward to a "bad browser" page, which works well for static content,
but not for requests destined to be handled by mod_jk.
Here's what I've got:
# Handle Mozilla Firefox
RewriteCond %{HTTP_USER_AGENT} Firefox/
RewriteCond %{HTTP_USER_AGENT}
!(Firefox/(3\.0\.19|3\.5\.9|3\.6\.3)($|[^\.0-9]))
RewriteRule .* /bad-browser.shtml [L]
For dynamic requests, this will happily allow the request to go through
to mod_jk.
I also tried this:
RewriteRule .* /bad-browser.shtml [L,H=alias]
This "works" in the sense that I get the page I want, but I also get a
404 error because the URL doesn't map to anything mod_alias can handle
successfully.
I also tried this:
RewriteRule .* /bad-browser.shtml [L,F]
This gives me a 403 response code, httpd's standard "forbidden" page,
and a 500 response code in the access log (looks like a runaway
redirect... I'll have to fix that).
Does anyone have any suggestions for getting:
1. My custom page rendered
2. A 403 (or any specific) response code sent to the browser
Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkwreD0ACgkQ9CaO5/Lv0PAdXACfaFIM1rOEuuUi57+9tQfC0m/C
OMAAnix1Hk+xb2YT6UvffIVWABYooT1R
=GFja
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org