1

So my question is similar to the question posed in this page

Single ErrorDocument directive to catch all errors (.htaccess)

The above person was trying to get a dynamic error page.

However my question is slightly different (although it may still have the same answer).

I am with a shared web host who displays custom error pages by default with ads on it. I want errors to result in a real error response without ads. Do I need to individually do a:

 ErrorDocument 404     /404.html

For each error? Or is there a way to just tell it to show a normal error message for all errors?

Is there some type of:

ErrorDirective JustOutputErrorInsteadOfRedirecting

Thank you in advance.

Community
  • 1
  • 1
Cade
  • 123
  • 1
  • 10

1 Answers1

0

With ErrorDocument directive you can also display Your custom error messeage on the same page.

ErrorDocument 404 "Sorry, the page does not exist!"

ErrorDocument 403 "Ohh, you don't have permission to access this page!"


ErrorDocument 410 "Sorry, the page no longer exists"

You can also format these messges using html tags

ErrorDocument 404 "<h2>Sorry, the page does not exist!</h2>"

ErrorDocument 403 "<h2 style='color:blue'>Ohh, you don't have permission to access this page!</h2>"


ErrorDocument 410 "<p>Sorry, the page no longer exists</p>"

The message will appear on the same page.

Amit Verma
  • 40,709
  • 21
  • 93
  • 115