Best Form Redirect Http --> Https VirtualHost Apache.

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

 



<VirtualHost *:80>
    # Valores generales del proyecto
    ServerAdmin administrador@xxxxxxxxxxx
    ServerName subdomain.example.com

    DocumentRoot /home/domain/public_html/subdomain

    Redirect "/" "https://www.subdomain.example.com"

</VirtualHost>

<VirtualHost *:443>
    # Valores generales del proyecto
    ServerAdmin administrador@xxxxxxxxxxx
    ServerName subdomain.example.com
   
    DocumentRoot /home/domain/public_html/subdomain

</VirtualHost>

According to the official documentation of apache the best way to redirect http to htpps, it is with redirect in a simple way, following this example in virtualhost I have a problem, for example:

http://subdomain.example.com   --> https://www.subdomain.example.com --> Assigned to virtual host works perfect.
http://subdomain1.example.com --> Is not assigned to any virtualhost, Because it redirects too https://www.subdomain.example.com

Regards,

--

Wilmer Arambula. 

[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