Re: redirect q

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 29, 2015 at 6:19 PM, K R <kp0773@xxxxxxxxx> 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

http://httpd.apache.org/docs/2.4/rewrite/avoid.html

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

https://wiki.apache.org/httpd/RedirectSSL

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

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux