Best way to redirect all traffic to secure website.

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

 



Hello,

I was following a post from a user asking about the best way to redirect all traffic on his server from port 80 to port 443.

Someone linked the original OP to https://httpd.apache.org/docs/2.4/rewrite/avoid.html#redirect

I decided to post my own question instead of hijacking his question.   For my website, I've been using RewriteCond and RewriteRules, but I'm questioning whether is now the best approach or not.

I have some subdomains that get redirected to different ports that run services that aren't port 443.  For example, when I go to subdomain1.mydomain.com, it redirects me to mydomain.com:2083.

In this case, could I use a redirect?   Something like:

<VirtualHost *:80>
    ServerName www.mydomain.com
    Redirect "/" "https://www.mydomain.com/"
</VirtualHost>

<VirtualHost *:80>
    ServerName subdomain1.mydomain.com
    Redirect "/" "https://subdomain1.mydomain.com:2083/"
    ...
</VirtualHost>

That seems a lot nicer than using all those dang rewrite rules.

Thanks!

[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