smbongtoi85
Verified User
- Joined
- Dec 9, 2019
- Messages
- 9
<?php
function get_domain($url)
{
$domain = $url;
if(preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs))
{
return $regs['domain'];
}
return false;
}
$domain = get_domain($_SERVER['SERVER_NAME']);
header('Location: http://' . $domain . '/mail');
die();
?>
for "/usr/local/directadmin/data/templates/custom/virtual_host2.conf.CUSTOM.4.post":
</VirtualHost>
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
ServerName mail.|DOMAIN|
ServerAdmin |ADMIN|
DocumentRoot /var/www/html/roundcube/my_redirect_to_mail.php
CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>
</VirtualHost>
<VirtualHost |IP|:|PORT_443| |MULTI_IP|>
ServerName mail.|DOMAIN|
ServerAdmin |ADMIN|
DocumentRoot /var/www/html/roundcube/my_redirect_to_mail.php
SSLEngine on
SSLCertificateFile |CERT|
SSLCertificateKeyFile |KEY|
|CAROOT|
CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
<IfModule !mod_ruid2.c>
SuexecUserGroup webapps webapps
</IfModule>