Jump to content

Display system 401 header?


barkster

Recommended Posts

I'm writing a http authorization script and instead of manually displaying the http header error is there a way to display the default apache error.  Or should I redirect to a custom error page?

 

header('WWW-Authenticate: Basic realm="Private"');
header("HTTP/1.0 401 Authorization Required");
echo "Your not authorized";

 

I want to display the default like this:

 

Authorization Required

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/1.3.41 Server at www.domain.com Port 80

Link to comment
https://forums.phpfreaks.com/topic/101066-display-system-401-header/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.