Redirect Domain/Site to Alternate Domain when Suspending
Hi. We have an account that has gone out of business. We want to redirect all traffic to their domain and old site (including all sub-pages) to an alternate domain before suspending their account.
I tried going into 'Redirects' in their cPanel account and setup a redirect from the root (so nothing added after the default '/') to this alternate domain, choosing to redirect with and without www, and with 'Wildcard Redirect' selected. In initial testing, this seemed to only be redirecting the root and not any sub-pages, but thought it might have been a caching issue.
So I then suspended the cPanel account. But now, any combination of their URL, with and without trailing '/' or any subpages, just displays the 'Account Suspended' page. This is not what we were hoping for!
- How can I retain a full redirect of any pages on their site while still disabling or suspending the site altogether, as it's just not needed anymore.
THANKS!
-
1. Unsuspend account
2. Change Password
3. Setup the redirect0 -
OK, thanks for replies. So based on this, setting up the redirect prior to the account being suspended will NOT function properly (which is what I'm seeing). I thought I had read in a couple places that as long as the redirect was setup before the account was suspended, it might continue to work.
- Would there be a way to edit this 'account_suspensions.conf' file to have the redirect point where we are desiring instead of to the default suspended account page? Or would that affect ANY/ALL suspended accounts?
0 -
No, you can't edit the account_suspensions.conf file manually - it even tells you not to do that inside the file.
Here's what that file looks like when an account gets suspended:
RewriteEngine On
<Directory "/home/cptest1">
AllowOverride none
RedirectMatch ^/(?!cgi-sys/suspendedpage.cgi).* /cgi-sys/suspendedpage.cgi
</Directory>Your best option would be the WHM >> Web Template Editor to customize the suspendedpage.cgi that gets used when an account is suspended, although that will apply to all domains.
0 -
Hi, thanks for the response.
A couple of our suspended accounts are still active sties hosted elsewhere, so we wouldn't want a global redirect that would send ALL suspended account traffic to a single redirect or URL (in case any DNS is still hosted or being hit on our server).
- So is our ONLY option to unsuspend an account so the redirect would be picked up and work?
- Any other creative solutions for this?
These organizations are part of a larger parent organization, so even when they close it would still be much more appropriate for traffic to hit the parent organization instead of a pretty bleak looking 'Account Suspended' page.
Even if the general suspended redirect would send to an account's root page where a local .htaccess file could set the individual redirect for the site (if necessary) would be beneficial.
Thanks again for any insight here!
0 -
if you suspend the account it means that the account till exists, so why don't you instead just empty the account, and set only .htaccess to do the redirect?
0 -
if you suspend the account it means that the account till exists, so why don't you instead just empty the account, and set only .htaccess to do the redirect?
So not suspend the account at all? Suppose we 'could' do that, but do like the management in WHM of having these accounts be suspended along with the other aspects that brings, and like the fact that the accounts 'could' be restored if for some crazy reason that ever was needed.
0 -
In the end, we ended up just modifying the default cPanel 'Suspended Account' page with a brief message and a meta redirect to the parent organization site. This works for a couple of the sites that have been suspended, and a couple other that are still active were not hitting the Suspended Account page anyway. So this works OK for now, but if any alternate sites need to be suspended in the future that don't make sense with this redirect we'll have to redo it.
Wish a simple redirect would have been simpler, but understand suspended users may abuse this unless it could be restricted by WHM admins...
0 -
You are always welcome to submit a feature request at features.cpanel.net if you'd like to see us improve or change that behavior - I handle that area as well and I'll make sure it gets reviewed.
0
Please sign in to leave a comment.
Comments
9 comments