• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

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