Re: Reditect HTTP to HTTPS .htaccess

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

 



I don't do this in .htaccess, I do it in <virtualHost>

<VirtualHost *:80>
   ServerName www.example.com
   ServerAlias example.com
   Redirect / https://www.example.com/
 </Virtualhost>

But something like this should work in .htaccess as well:

RewriteEngine On 
 RewriteCond %{SERVER_PORT} 80 
 RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

I think, perhaps based on nothing at all, that doing it in VirtualHosts works better.

-- 
My main job is trying to come up with new and innovative and effective ways to reject even more mail. I'm up to about 97% now.

> On Mar 3, 2018, at 15:34, Wilmer Arambula <tecnologiaterabyte@xxxxxxxxx> wrote:
> 
> What would be the best way to redirect http to https, I have searched in google and tried several configurations but so far I have not been able to make it work correctly ?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[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