Adding custom httpd.conf code to the Virtual Host of a domain

aitor91

New member
Joined
Jul 4, 2014
Messages
4
How add custom httpd.conf code to the VirtualHosts of a domain in the directadmin interface?

I need to add this lines to redirect http to https on my domains in the VirtualHost Port 80 and 443:

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

<VirtualHost *:443>
      # Use HTTP Strict Transport Security to force client to use secure connections only
      Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

      # Further Configuration goes here
      [...]
</VirtualHost>
 
Hello,

If you need for all domains:

- Using a custom VirtualHost template
http://help.directadmin.com/item.php?id=2

If you need need for selected domains:

Code:
|*if SSL_TEMPLATE="0"| 
         Redirect "/" "https://www.example.com/"
|*else|
         Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|*endif|
 
Back
Top