skip to Main Content

Let’s say I have www.mydomain.com set up in Plesk 12. How can I create an alias like mydomain.mycompany.com for that domain? Currently Plesk adds automatically the www prefix.

Thanks!

5

Answers


  1. What you really want to do is add a SUB DOMAIN not a domain alias. Here is a help article https://www.conetix.com.au/support/article/how-add-sub-domain-plesk-12 .

    Login or Signup to reply.
  2. Think your domain has www redirect, if you disable it on domain, alias should not have www prefix too.

    Please check this answer about auto www prefix: https://stackoverflow.com/questions/23546923/website-getting-redirected-to-drop-www-from-url/23547600#23547600

    Login or Signup to reply.
  3. Had somewhat the same problem.

    I wanted domain.com to redirect, but only http://www.domain.com did.

    In the Domain Alias page, uncheck “Synchronize DNS zone with the primary domain”.
    Then there will be DNS records for the domain alias itself. For me this did the trick, because there was an A-record without www and an CNAME with www and both with and without www will work.

    Maybe you can add a record to mydomain.mycompany.com there too.

    Login or Signup to reply.
  4. I had the same problem, added a DNS A-Record *.domain.ltd
    Then added a Domain Alias and unchecked “Synchronize DNS zone with the primary domain”, checked “Webservice” and “301 Redirect” in Plesk, that worked for me.

    Login or Signup to reply.
  5. The unwanted "www" server alias is hardcoded in the virtual host config template. Modification is easy though. You have to create a custom virtual host config template with only one line removed.

    Infos in the manual: https://docs.plesk.com/en-US/obsidian/advanced-administration-guide-linux/virtual-hosts-configuration/changing-virtual-hosts-settings-using-configuration-templates.68693/

    These are the steps to remove the "www" server alias for Apache Webserver:

    Step 1: Create a folder for custom domain templates

    sudo mkdir -p /usr/local/psa/admin/conf/templates/custom/domain
    

    Step 2: Add a copy of the default template to the custom template folder

    sudo cp /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php
    

    Step 3: Comment out the "www" server alias

    sudo sed -i 's/    ServerAlias "www.<?php echo $alias->asciiName ?>"/#    ServerAlias "www.<?php echo $alias->asciiName ?>"/' /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php
    

    Step 4: Reconfigure webserver configurations

    sudo /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search