Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"deny from all" with a custom message?

Tags:

.htaccess

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?

like image 661
Nate Avatar asked Jul 25 '14 21:07

Nate


2 Answers

Try adding a:

ErrorDocument 403 /special_message.html

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

like image 134
Jon Lin Avatar answered Oct 17 '22 06:10

Jon Lin


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

ErrorDocument 403 "Account Suspended"

I think last quote is optional too.

like image 5
yo lo Avatar answered Oct 17 '22 05:10

yo lo