1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

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

Discussion in 'Plesk for Linux - 8.x and Older' started by KingSky, Apr 30, 2005.

  1. KingSky

    KingSky New Pleskian

    Mar 10, 2005
    Likes Received:
    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:

    ServerAlias cp.@domain_name@
    Options +FollowSymLinks 
    RewriteEngine on 
    RewriteCond %{HTTP_HOST}  !^(www\.)?@domain_name@
    RewriteCond %{HTTP_HOST}  ^(cp\.)?([^\.]*)\.com 
    RewriteRule ^(.*)$
    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?