Re: Re: Reditect HTTP to HTTPS .htaccess

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

 



On 03/04/2018 08:07 AM, LuKreme wrote:
> 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.

Well, at the very least you only have to parse it once at startup.  If
you don't have a .htaccess file at all you also save an extra file open
on every hit.

-- 
D'Arcy J.M. Cain
System Administrator, Vex.Net
http://www.Vex.Net/ IM:darcy@xxxxxxx
VoIP: sip:darcy@xxxxxxx

---------------------------------------------------------------------
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