How to redirect hostname URL to Plesk control panel URL login page: cp.example.com to cp.example.com:8443

Created:

2017-07-10 10:52:52 UTC

Modified:

2017-08-16 16:29:38 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to redirect hostname URL to Plesk control panel URL login page: cp.example.com to cp.example.com:8443

Applicable to:

  • Plesk for Linux

Question

How to redirect hostname URL to Plesk control panel URL login page: cp.example.com to cp.example.com:8443?

Answer

  • Using Apache:
    1. Log in to the server over SSH. Use instructions from article: How to connect to a Plesk server using SSH/RDP
    2. Create the file /var/www/vhosts/default/htdocs/.haccess in a text editor, for example:
      # vi :/var/www/vhosts/default/htdocs/.htaccess
    3. Add the following line to the file:
      Redirect 301 / https://cp.example.com:8443/
    4. Ensure that access permissions and ownership of the file .htaccess are the following:
      # stat .htaccess | grep Access:
      Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
  • Using iptables:
    # iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 8443

Note: iptables rule does not work for containers!

Have more questions? Submit a request
Please sign in to leave a comment.