apacheerrordocument

How to disable Apache ErrorDocument Message


I need to disable Apache 401 error message or bypass it completely , in case of errors only back end application error codes should be displayed.

Thanks Rakesh


Solution

  • Add following to your .htaccess file (works if AllowOverride allows it).

    ErrorDocument 401 /URL/TO/YOUR/BACKEND/RESPONSE

    Custom error documents are configured using the ErrorDocument directive, which may be used in global, virtualhost, or directory context.

    More info about Apache ErrorDocument