• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Distinguishing www directory from the domain one

fbartolom

New Pleskian
I would like to direct accesses to www.domain and to domain to two different directories in Plesk. Yet when I try to add the www subdomain it says it is already there and in fact when I edit the 'domain' hosting setting a www is pre-printed before the editable domain name, differently from the other subdomain ones where the domain is pre-preinted instead. How may I set the thing to work the way I need?

Thanks, Fabrizio
 
i think it is a bit of an overshooting for just enabling a separate www directory. Are you sure there is no easier way? At any rate I found interesting the issue about error messages, I shall have to implement them to lead user to a custom error message I manually enabled on the old server.
 
Also
i think it is a bit of an overshooting for just enabling a separate www directory. Are you sure there is no easier way? At any rate I found interesting the issue about error messages, I shall have to implement them to lead user to a custom error message I manually enabled on the old server.
the editing should be done by editing php scripts, not configuration files, and tweaking factory code is a sure recipe for disaster. That is why inheritance was invented, for that matter.
 
At any rate I think I managed to modify the right piece of code:
PHP:
<?php foreach ($VAR->domain->webAliases AS $alias): ?>
    ServerAlias "<?php echo $alias->asciiName ?>"
<?php if (strcmp($alias, "taxiprofessional.net")) ?>
    ServerAlias "www.<?php echo $alias->asciiName ?>"
    <?php if ($OPT['ipAddress']->isIpV6()): ?>
    ServerAlias "ipv6.<?php echo $alias->asciiName ?>"
    <?php else: ?>
    ServerAlias "ipv4.<?php echo $alias->asciiName ?>"
    <?php endif; ?>
<?php endforeach; ?>
Yet when I connect to Plesk after having executed:
sudo /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain taxiprofessional.net
I see no change altogether: it is still complaining:
Incorrect subdomain name www.taxiprofessional.net: the domain taxiprofessional.net already has the WWW prefix.
or
Error: Failed domain creation: Incorrect name www.taxiprofessional.net. This domain name already exists without the 'www' prefix.
I am unsure if my error is in the script or in the procedure.
 
Last edited:
Back
Top