- Plesk for Linux
How to make Plesk redirect panel requests from domains
Such functionality has not been implemented in Plesk yet. Provide the suggestion for the new functionality on User Voice .
The top-ranked suggestions are likely to be included in next versions of Plesk.
However, as a workaround, a script attached to this article could be used. To use the script:
- Connect to the server using SSH.
- Download archive with script:
- Unpack it:
# tar -zxvf patch.tar.gz
- Make script executable:
# chmod +x ./gen-inc.sh
- Run it, it will create skeleton configs for the redirect and add a hook entry to the server:
Note: If it returns "To modify config 'patch' packet must be installed" then the 'patch' application should be installed on the server.
/etc/sw-cp-server/conf.d/redirect.incfile to set-up redirect rules:
# nano /etc/sw-cp-server/conf.d/redirect.inc
server_name example1.com;< Example of 'From' entry.
return 301 https://example.com:8443;< Example of 'To' entry.
Note: If the same hostname is set in 'From' and in 'To' field, then Plesk UI will become unreachable.
- Restart sw-cp-server:
# service sw-cp-server restart
Note: There must be only one return entry. Future updates might overwrite changes made by the script. To fix it, simply run the script again. All rules will persist