<VirtualHost *:80>
  DocumentRoot /usr/share/alternc/panel/admin

  AssignUserId alterncpanel alterncpanel
  SetEnv LOGIN "0000-panel"

  ServerName %%fqdn%%

  # Mail autoconfig
  RewriteRule ^/mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^/mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^/autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^/Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^/Autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^/autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^Autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^autodiscover.xml$ mailautoconfig_outlook.php [L]

</VirtualHost>

<VirtualHost *:443>
  DocumentRoot /usr/share/alternc/panel/admin

  AssignUserId alterncpanel alterncpanel
  SetEnv LOGIN "0000-panel"

  ServerName %%fqdn%%

  # Mail autoconfig
  RewriteRule ^/mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^/mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
  RewriteRule ^/autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^/Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^/Autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^/autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
  RewriteRule ^Autodiscover.xml$ mailautoconfig_outlook.php [L]
  RewriteRule ^autodiscover.xml$ mailautoconfig_outlook.php [L]

  SSLEngine On
  SSLCertificateFile %%CRT%%
  SSLCertificateKeyFile %%KEY%%
  %%CHAINLINE%%

</VirtualHost>