Redirect 401 “authorization required page” to custom page

主宰稳场 提交于 2019-12-11 18:52:32

问题


Is there a simple way I can encode a front-end php redirect to a custom page upon error?

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

Would be great to have custom error pages as a solution to this.

Thanks!


回答1:


In the .htaccess file, just add

ErrorDocument 401 /401.html

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



来源:https://stackoverflow.com/questions/16479493/redirect-401-authorization-required-page-to-custom-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!