7

I'm moving to a new server and want to take all of my sites offline during the transition. I know I can put this in my root .htaccess file to block people from visiting the site:

order deny,allow
deny from all 

But I want to also output a message explaining why the site is down. Is this possible?

Nate
  • 26,164
  • 34
  • 130
  • 214

2 Answers2

11

Try adding a:

ErrorDocument 403 /special_message.html

where the /special_message.html is the file that contains your message.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • This is a good start, but doesn't work with sub-URLs, if you're getting message similar to `Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.` See this answer of mine for solution - https://stackoverflow.com/a/66322976/1835470 – jave.web Aug 21 '22 at 13:50
5

you can add a message directly from .htaccess file, eg:

ErrorDocument 403 "Account Suspended"

I think last quote is optional too.

yo lo
  • 59
  • 1
  • 3