httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurtis Rader <>
Subject Re: [users@httpd] redirect q
Date Wed, 30 Sep 2015 01:34:03 GMT
On Tue, Sep 29, 2015 at 6:19 PM, K R <> wrote:

> I am trying to force redirect HTTP to HTTPS  as below
> RewriteEngine On
> RewriteCond %{HTTPS} !=on
> RewriteRule ^/?(.*)  https://%{SERVER_NAME}/$1 [R,L]
> but it fails with too many redirect error .

Did you google "apache https redirect"? The second result (for me anyway)
is to

which explains why you shouldn't use mod_rewrite for this. See also

Having said that I don't see anything obviously wrong with what you showed
us other than you probably should be using %{HTTP_HOST} and the RewriteRule
statement is needlessly complicated (but then so are most of the examples I
saw from the google search recommended).

Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

View raw message