1

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!

sdagkas
  • 578
  • 1
  • 5
  • 20

5 Answers5

0

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 .

  • How do I serve the same website from the subdomain without duplicating the website's files? – sdagkas May 13 '15 at 10:59
  • I will see if I have time to do up another support article however, you need to do the following. Once you have created the SUB DOMAIN you then need to click into that new SUB DOMAIN and then Click on Hosting Settings. You will see HOSTING Type - Website. Click on Change and then you will see a drop down menu change it to forwarding and then enter in the domain or original site i.e www.yourdomain.com then click OK. This should forward any traffic to your sub domain to your main domain or other website with content. NB. You will need to have subdomain setup in your DNS for it to work. – Jamin Andrews May 14 '15 at 03:49
0

Think your domain has www redirect, if you disable it on domain, alias should not have www prefix too.

Maybe following steps can help you:

  1. Go to subscriptions
  2. Click the domain you would like to manage
  3. Go to websites & domains
  4. At the bottom of the page, find your domain (you will see "Hosting Settings" link next to it)
  5. Click on "Hosting Settings"
  6. Select "www" in the "Preferred domain"-dropdown
  7. Save the settings by clicking "OK"

plesk-preferred-domain-redirect-www

Oleg Neumyvakin
  • 9,706
  • 3
  • 58
  • 62
  • I set "Preferred domain" under hosting settings to "none" but the www prefix still shows when adding a domain alias. – Dave Jun 28 '16 at 09:11
  • it's ok, "Preferred domain" enables 301 redirects to preferred name, but names(like "www" part) are always creating by plesk. – Oleg Neumyvakin Jun 28 '16 at 09:42
0

Had somewhat the same problem.

I wanted domain.com to redirect, but only 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.

0

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.

0

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