• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Any subdomain to main folder, but www.domain to subdomain folder

Hello.
I have situation below.

I need that any subdomain goes to main folder /var/www/vhosts/domain/httpdocs and that is reached with A record
*.domain.com A server's IP

but www.domain.com must be opened from another folder. I have created subdomain www for that. Thus page must be loaded from /var/www/vhosts/domain/subdomain/www/httpdocs

Everything is working if I edit /var/www/vhosts/domain/conf/httpd.include file though I must move script for www.domain.com subdomain before main virtual host like this

<VirtualHost 64.150.164.189:80>
ServerName www.domain.com:80
DocumentRoot /var/www/vhosts/domain.com/subdomains/www/httpdocs
CustomLog /var/www/vhosts/domain.com/statistics/logs/access_log plesklog
ErrorLog /var/www/vhosts/domain.com/statistics/logs/error_log
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory /var/www/vhosts/domain.com/subdomains/www/httpdocs>
<IfModule mod_php4.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/domain.com/subdomains/www/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/domain.com/subdomains/www/httpdocs:/tmp"
</IfModule>
Options -Includes -ExecCGI
</Directory>
</VirtualHost>

<VirtualHost 64.150.164.189:80>
ServerName domain.com:80
DocumentRoot /var/www/vhosts/domain.com/httpdocs
CustomLog /var/www/vhosts/domain.com/statistics/logs/access_log plesklog
ErrorLog /var/www/vhosts/domain.com/statistics/logs/error_log
<IfModule mod_userdir.c>
UserDir /var/www/vhosts/domain.com/web_users
</IfModule>
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory /var/www/vhosts/domain.com/httpdocs>
<IfModule mod_php4.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/domain.com/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/domain.com/httpdocs:/tmp"
</IfModule>
Options -Includes -ExecCGI
</Directory>
<Directory /var/www/vhosts/domain.com/web_users>
<IfModule mod_php4.c>
php_admin_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine off
</IfModule>
</Directory>
Include /var/www/vhosts/domain.com/conf/vhost.conf
</VirtualHost>

But Plesk will restore httpd.include file. Therefore I've created vhost.conf file and now there:

ServerAlias www.domain.com "www.domain.com"
ServerAlias *.domain.com "domain.com"

And Now, if I go to domain.com, www.domain.com or something.domain.com the folder /var/www/vhosts/domain/httpdocs is used.

What I should to do at vhost.conf file?
 
Last edited by a moderator:
Back
Top