Redirect 401 "login page" to custom page

Is there an easy way to code an external php redirect to a custom page on error?

I have a page in a directory protected by a .htaccess password, but if you cancel the system dialog or enter the wrong details, you get a simple html message in the browser and should go back.

It would be great if it had error pages.

Thank!

0


source to share


2 answers


In your .htaccess file, just add

ErrorDocument 401 /401.html

      



And change 401.html to the name of the file you want to display.

+3


source


This is exactly the same need, but so far this code is not being executed as expected. Adding a line to .htaccess that is in the same directory as the password file.



0


source







All Articles