• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

[HOW TO] use cp.domain.com instead of www.domain.com:8443

KingSky

New Pleskian
It took me hours to figure this out, but I finally have it working!

In your vhost.conf and vhost_ssl.conf files for each virtual host (located in /home/httpd/vhosts/domain.com/conf)

Add this code:

Code:
ServerAlias cp.@domain_name@
Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST}  !^(www\.)?@domain_name@
RewriteCond %{HTTP_HOST}  ^(cp\.)?([^\.]*)\.com 
RewriteRule ^(.*)$
[url]https://www.@domain_name@:8443[/url]

Keep in mind that if this file isn't there, you just need to create it.

Make sure to replace @domain_name@ with your domain name. You can put this code directly in your .skel/conf files with no changes to the above code so that new domains are already set up this way :)

The only problem with this code is this line:

RewriteCond %{HTTP_HOST} ^(cp\.)?([^\.]*)\.com

does anybody know how to modify it so that it catches all tld's besides .com?
 
Back
Top