httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeroen Geilman <>
Subject Re: [users@httpd] RewriteRule acts differently for different browsers
Date Mon, 25 Jul 2011 19:14:53 GMT
On 2011-07-25 20:45, James Moe wrote:
> Hash: SHA1
> Hello,
>    apache v2.0
>    The reason for this redirection is that when I purchased the SSL
> certificate, I did not know to get one for than the domain's URL,
> <>. A secure connection to<>  brings up
> the warning about a possibly "untrusted site."

You should not use rewriting for this, it is entirely unnecessary and 
only adds complexity.
Instead, you add a new vhost for, and do a blank 
redirect to HTTPS.

> RewriteEngine on
> RewriteCond %{HTTP_HOST}
> RewriteRule ^/(.*)$$1 [L,R]
>   For the browsers Firefox v5 linux, Chrome v12.0 linux, Opera v11.5
> linux, Semaonkey v2.1 os/2, Safari v5.0 windows, Internet Explorer v8, I
> get different redirections for the URL<>.
>    Firefox:<--Not a typo!
>     Chrome:
>      Opera:
> Seamonkey:
>     Safari:
> IExplorer:
>    Only Chrome redirected like I thought the rule indicates.
>    Is this to be expected? It seems rather arbitrary.

I suspect that the above is using the highly dubious VirtualHost * 
construct, which should die and burn in hell.
If so, you are not taking into account the possibility that the request 
is coming in over HTTPS.
Add another rewritecond that checks for it.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message