Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have suspended a website on Plesk and i want to show users a custom page. Do you guys know how to do it?

share|improve this question

The question seems to be asking more for how to set a server-wide custom error message rather that how to customize the error messages for just one site at a time.

Try this:

Create a new file /etc/httpd/conf.d/customerrors.conf

Add the following contents to the file:

Alias /error/ "/var/www/error/"

ErrorDocument 400 /error/HTTP_BAD_REQUEST.html
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html
ErrorDocument 403 /error/HTTP_FORBIDDEN.html
ErrorDocument 404 /error/HTTP_NOT_FOUND.html
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html
ErrorDocument 410 /error/HTTP_GONE.html
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html

You can just add the 503 document if you are only interested in customizing the "service unavailable" message that come up when you suspend a site, but if you want to customize all default server error messages, might as well do it all at once with the above.

There are more complex ways to do it that include international language support and default headers and footer, etc, but I'm just sticking with a flat HTML file for each error for now.

Now if you want to override the error messages for an individual site you can edit that site's .htaccess file with the same ErrorDocument section from above but point it to different files just for that one site.

share|improve this answer

Yeah, you have to unsuspend the site and set the main page from the list of the error pages which should be located in your main site directory.

share|improve this answer

There are a couple of ways to do this:

One way is to unsuspend it and then move all the site files into a subdirectory. That means that every page will return a 404 error. You then edit your custom error page for that error to show the users the custom page.

Or you can put it in maintenance mode and edit your 503 custom error page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.