Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在开发过程中保护Codeigniter应用程序_Codeigniter_.htpasswd - Fatal编程技术网

在开发过程中保护Codeigniter应用程序

在开发过程中保护Codeigniter应用程序,codeigniter,.htpasswd,Codeigniter,.htpasswd,在开发过程中,如何使用带有htpasswd的Codeigniter保护我的webapp构建? 我试过了,但有500个错误 AuthType Basic AuthName "Authenticate please" AuthUserFile /usr/html/.htpasswd Require valid-user RewriteEngine on RewriteCond $1 !^(index\.php|assets|files|css|robots\.txt) RewriteRule ^(

在开发过程中,如何使用带有htpasswd的Codeigniter保护我的webapp构建? 我试过了,但有500个错误

AuthType Basic
AuthName "Authenticate please"
AuthUserFile /usr/html/.htpasswd
Require valid-user

RewriteEngine on
RewriteCond $1 !^(index\.php|assets|files|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

你的授权看起来不错,我有下面的,工作正常。是否确定已正确创建.htpasswd文件,并且该文件位于指定的位置

<Files *>
AuthName "Please Login"
AuthType Basic
AuthUserFile /var/www/.htpasswd
require valid-user
</Files>

AuthName“请登录”
AuthType Basic
AuthUserFile/var/www/.htpasswd
需要有效用户

我想说你的重写条件和规则有问题。您不使用此处的文件的原因是什么?>

您的完整htaccess文件看起来如何?@JonathanClark与我在网站上提供的auth内容链接上显示的完全一样top@JonathanClark我只是好奇,既然你接受了我的答案,问题出在哪里?