disable https redirect for a specific subdomain

ASghostKI

Verified User
Joined
Oct 30, 2020
Messages
30
Hello,

I have a domain name where the https redirect is enabled:
1612314147038.png

There is some subdomain of the domain, and one of them only one I need to disable this option for it, how can do it?

Any help will be appreciated folks.
 
Just disable it for the full domain. Then use a .htaccess in the public_html of that domain for the redirect with an exclusion for the subdomain.
 
Thanks, That's what I thought I can do, but I was hopping for a cleaner way for this.
 
Actually I figured out "the cleaner" way to do this
I went to my /usr/local/directadmin/data/templates/custom/virtual_host2_sub.conf
and I added a condition to the |FORCE_SSL_REDIRECT|

So instead of this it looks like this:
Code:
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
...
    |FORCE_SSL_REDIRECT|
...

It looks like this now:
Code:
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
...
    |*if SUB!="mysubdomain"|
    |FORCE_SSL_REDIRECT|
    |*endif|
...
So when my httpd config gets generated, it adds the HTTPS rewrite rule only for other domains/subdomains.
 
Back
Top