How to change Plesk redirect URL

Created:

2016-12-18 06:54:14 UTC

Modified:

2017-08-08 13:16:39 UTC

1

Was this article helpful?


Have more questions?

Submit a request

How to change Plesk redirect URL

Applicable to:

  • Plesk 12.5 for Linux

Question

How to redirect customers to something other than the hostname for Plesk URL.

Example:hostname.example.com is the server's hostname, foobar.com is hosted on hostname.example.com.

Going to foobar.com:8443 will redirect to https://hostname.example.com:8443

How to redirect to a different domain without changing the server's internal hostname?

Answer

Such behavior is not supported by Plesk, however a workaround is available:

  1. Create a backup of /etc/sw-cp-server/config file:

    # cp -p /etc/sw-cp-server/config{,.back}
  2. Made sure that non-hostname.com name is resolved to the server's IP address.

  3. Update the file in the following way:

    # grep error_page /etc/sw-cp-server/config
    # error_page 497 https://$hostname:$server_port$request_uri;
    error_page 497 https://non-hostname.com:$server_port$request_uri;
  4. Restart sw-cp-server service:

    # service sw-cp-server restart

Please note:

  1. This change can be overwritten by Plesk microupdates and Plesk upgrade.
  2. Perform it at your own risk and verify this solution on a test environment.
Have more questions? Submit a request

1 Comments

Please sign in to leave a comment.