Codeigniter 中的 .htpasswd
你好,我想用密码保护 codeigniter 中的一个控制器。这是 .htaccess 中的代码,
# password-protect single file
<Files my_controller.php>
AuthName "my_controller.php"
AuthType Basic
AuthUserFile /home2/afolder/.htpasswds/.htpasswd
require valid-user
</Files>
问题是 myController.php 将在我的 url 中显示为 /my_controller/
(无 .php),因此保护无效...我可以做些什么吗克服这个问题? 提前致谢
Hello there I want to password protect one of my controllers in codeigniter. This is the code in .htaccess
# password-protect single file
<Files my_controller.php>
AuthName "my_controller.php"
AuthType Basic
AuthUserFile /home2/afolder/.htpasswds/.htpasswd
require valid-user
</Files>
the problem is that myController.php will show up in my url as /my_controller/
(no .php) so the protection has no effect...can I do something to overcome this problem?
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后解决方案就这么简单...
只需删除 .php 一切都很好...
Finally the solution was as simple as that...
just removed .php and everything is fine...