• 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!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.

Resolved Need help with configure of dynamic virtual host subdomain creation

cipcip

Basic Pleskian
Hello guys,

I changed my host and everything I had on the old one, I replicated to the new one and it does not work. Maybe I am missing something ?!
I have a dedicated server that is using plesk as a control panel. The old one was a cloud vps using webuzo as a control panel

What I did:
  1. In plesk I went to that specific domain and changed the Apache & nginx settings to add the virtual host, like so:

Code:
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
UseCanonicalName Off
</VirtualHost>

2. I add the *.example.com A record in my domain control panel

3. My htaccess looks like so (although it worked on the last server, so I assume everything is ok)

Code:
<Files .htaccess>
order allow,deny
deny from all
</Files>

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^login$ login.php
RewriteRule ^/?edit/([^/.]+)$ ./edit.php?url=$1
RewriteCond %{HTTP_HOST} ^(.*).example.com
RewriteRule .* view.php?url=%1 [L,NC,QSA]
</IfModule>

I know that the question is not necessarily Plesk related, but I am struggling for days and couldn't find an answer :(

Thank you,
Cristian
 
1. In plesk I went to that specific domain and changed the Apache & nginx settings to add the virtual host, like so:

Code:
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
UseCanonicalName Off
</VirtualHost>
You've said you went to the specific domain, so I assume you have added the domain through Plesk GUI? If so, the example.com should simply work, if the DNS has been correctly set up and has propagated. There is no need to manually add anything under Apache & Nginx settings, just remove the above.

Refer to the documentation:

Adding and Removing Domains

Adding Wildcard Subdomains (linux)
 
Thank you @Ales for the pointers.
Creating a wildcard subdomain did the trick. I cannot believe that the answer was this easy and I banged my head for days trying to figure this out.
 
Back
Top