Articles in this section

How to configure redirect from Web Server's Default Page or existing domains to the Plesk login page on port 8443 on Plesk for Linux?

kb: how-to Plesk for Linux ABT: Group B

Applicable to:

  • Plesk for Linux

Question

On a Plesk for Linux server, a redirect to the Plesk login page on port 8443 must be configured from the web server's default page or an existing website in Plesk.

How can this be done?

Answer

Warning: Configuring the redirect will result in an inability to issue/renew Let's Encrypt certificate due to the Let's Encrypt requests are performed with ports 80/443

Configure a redirect from the Web Server's Default Page
  1. Connect to the server via SSH
  2. Create the file /var/www/vhosts/default/htdocs/.htaccess:

    # touch /var/www/vhosts/default/htdocs/.htaccess

  3. Add the following content to it using text editor:

    CONFIG_TEXT: RewriteEngine On
    RewriteCond %{HTTP_HOST} ^203.0.113.2$ 
    RewriteCond %{HTTP_HOST} ^203.0.113.3$ 
    RewriteRule ^.*$ https://example.com:8443/ [R,L] 
    Redirect 301 / https://example.com:8443/

    Note: 203.0.113.2, 203.0.113.3 and example.com should be replaced with public IP addresses and hostname of the server respectively.

Configure a redirect from a domain that exists in Plesk
  1. Log in to Plesk GUI
  2. Go to Domains > example.org > Apache & nginx Settings
  3. Add the following additional directives:

    • If the field Additional nginx directives is present, add the following content to it's beginning:

      CONFIG_TEXT: return 301 https://example.com:8443/;

    • If the field Additional nginx directives is absent, add the following content to both fields Additional directives for HTTP and Additional directives for HTTPS:

      CONFIG_TEXT: Redirect "/" "https://example.com:8443/"

    Note: example.com should be replaced with the hostname of the server.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.