• 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

Resolved Configure DNS of Server Hostname.

Pentarou

Basic Pleskian
Hello,

Although I know a lot about configuring my external DNS, I do not fully understand the following:

My primary website is example.com, my plesk server hostname is hostname.example.com. How do I make hostname.example.com point to my plesk admin, instead of my website?

Thank you in advance!
 
  1. Login to the server via SSH;
  2. Create /var/www/vhosts/default/htdocs/.htaccess file:
    Code:
    touch /var/www/vhosts/default/htdocs/.htaccess
  3. Paste the following content using the favorite text editor:
    Code:
    CONFIG_TEXT:RewriteEngine On
    RewriteCond %{HTTP_HOST} ^203.0.113.2$
    RewriteCond %{HTTP_HOST} ^203.0.113.3$
    RewriteRule ^.*$ https://server_hostname:8443/ [R,L]
    Redirect 301 / https://server_hostname:8443/


    How to redirect from Web Server's Default Page to Plesk login page?
 
Thank you kindly for your reply, m3lezZ,

I added my own hostname and IP to the rewrite rule and added it to my .htaccess file, now both hostname.example.com and example.com redirects to plesk admin. What's going on and how do I fix this? (other than removing the rewrite rule of course)
 
Add the hostname.example.com in plesk as subdomain with hosting.

Move or Create the .htaccess in the dictionary of the subdomain.(Delete it in the main-domain)

That should work.


Best regards
 
I think you're up for a bad surprise the day your Apache or Nginx services will stop functioning (for whatever reason)...

I think there is a very good reason for keeping the administrative web UI decoupled from the domain's web servers.
 
Hello Sergio Manzi,

Unless you know how to successfully assign a Let's Encrypt SSL certificate without using the host name, I fully agree.
 
Unless you know how to successfully assign a Let's Encrypt SSL certificate without using the host name, I fully agree.

Not only that: if you make an habit of accessing the administrative interface through the redirection set up in the .htaccess of the "normal" domain, you will not be able to access it the day that your Apache or Nginx servers are down.

That's probably not a big issue if you're the only one using the Plesk web UI, but it may confuse other collaborators/customers.
 
I am the only one who works the administration, but I'm open for improvements regarding accessing the administrative interface.
 
Thanks for the advice, I don't mind the typing if it helps to better secure my server.

pt_joy.jpg
 
Back
Top