Re: Redirect http to https

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

 



Make sure you put these in the correct VHOST. They need to be in the :80 vhost, not the :443 vhost.

I usually use the Redirect directive (http://httpd.apache.org/docs/2.4/mod/mod_alias.html#redirect) instead.

- Y

On Wed, Jan 28, 2015 at 4:55 PM, Chris Arnold <carnold@xxxxxxxxxxxxxxxxxxx> wrote:

Apache 2.4.10 on SLES 12. I am trying to redirect port 80 requests to 443 so that http://share.domain.tld results in https://share.domain.tld. Here is what i have tried in the vhost file:


RewriteEngine On
#Redirect share.domain.tld port 80 requests to SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^/share(.*) https://share.domain.tld/share/ [R=301,L]


I also tried:


RewriteEngine On
#Redirect share.domain.tld port 80 requests to SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://share.domain/share/ [R=301,L]

(This redirects every request to https://share.domain.tld/share


Any hints or pointers on making this work?



[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