Password Protected Webpage error with wrong password
I just added password protection to a few directories on my website, however, when I test it and enter a wrong password, I get an error screen that takes me away from my site. Is there a way to more graciously handle the wrong entry, like returning to the signin and or invalid signin message and return to the form?
Thanks for the info, not going to pursue a payware solution, on a budget.
Hi Lewis, good news! I discussed this issue with one of our senior technicians and learned of a way to do this that I was not previously aware of. If you add a line like the below to your .htaccess file
Then, you can redirect to a custom error page. In this example, that is an html page named unauthorized, which you would then need to code yourself and place in your site directory, but you can use this to either send users to a nicer page if they type the wrong password, or even put in a redirect from that page back to the homepage.
Also, the passwords for this are are stored in ~/.htpasswds/.
Hope that helps!