dongpo2014 2013-02-21 20:56
浏览 44
已采纳

.htaccess而不是用户名密码保护

I am just coding a small website with an admin panel. Since I am going to be the only one who will access that panel I was thinking instead of making traditional username - password matching just make simple .htaccess file to admin folder as

 <Limit GET POST>
 order deny,allow
 deny from all
 allow from myip
 allow from 127.0.01
</Limit>

So the question is since my ip is static. This kind of protection will be secure or do I have to do it with username - password matching ?

Also if the idea is logical but .htaccess needs more additions what would they be ?

  • 写回答

3条回答 默认 最新

  • douzong6649 2013-02-21 21:12
    关注

    Restricting by IP is a perfectly valid alternative to protecting with a password, but less flexible for access.

    If you use SSL then you could implement SSLRequire to make things more flexible whilst still "password-less" (note issue with threaded MPM).

    However, for the small amount of effort that it would take to implement password protection using HTTP authentication I would argue that you should be as secure as possible. Even if it is a personal website, it can still be hijacked and used to send SPAM, etc.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)