Plesk Panel – Suspend Account with notification web page – SOLVED

I ran into the problem of having to suspend an a customers account and then noticed that after suspension it showed the default new site page from server doc root.
Next I noticed there was no way to set a default page for suspended domains so I wrote a script that can be run and will edit the .htaccess file for the root htdoc of the server and add rewrite rules to point to suspended.htm. This will also query the PSA DB and create rewrite rules for any domain aliases for that domain as well.

Just run this script after suspending domain and verify redirect by trying to access suspended domain.

Edit “suspend.html” to say whatever you want.

Feel free to let me know if there are any issues or suggestions for this, or feel free to modify as needed.

Files:
gensusp.php (run via “php -q gensusp.php suspendDomain.com /path/to/server/root/.htaccess”)
psadb.inc (psa db connectivity to query for domain aliases. if your mysql username is NOT “admin” then edit this file)
suspend.html (this should be placed in the same directory as the index.html file for the default server root, usually: /var/www/vhosts/default/htdocs/)

Feedback would be greatly appreciated.

PS: if you re-enable the account you will need to manually remove those rules (which are well commented) from the server root’s .htaccess file.

gensusp.zip

Share