Php .htaccess导致wamp上出现内部服务器错误
我正在使用用于Windows的Wamp服务器。我在www目录中有一个名为“tester”的文件夹。在我将.htaccess文件放入“tester”文件夹之前,一切正常。这是我的.htaccess文件:Php .htaccess导致wamp上出现内部服务器错误,php,apache,.htaccess,Php,Apache,.htaccess,我正在使用用于Windows的Wamp服务器。我在www目录中有一个名为“tester”的文件夹。在我将.htaccess文件放入“tester”文件夹之前,一切正常。这是我的.htaccess文件: //Stop hotlinking RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost/tester/.*$ [NC] RewriteRule \.(jpg|jpeg|cpp|
//Stop hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost/tester/.*$ [NC]
RewriteRule \.(jpg|jpeg|cpp|java|c|txt|in|out|exe|o|ico|png)$ localhost/tester/signin.php[R=302,L]
//Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
//Prevent directory listings
Options All -Indexes
//停止热链接
重写cond%{HTTP_REFERER}^$
重写cond%{HTTP_REFERER}^http://(www\)?localhost/tester/*$[NC]
重写规则\(jpg | jpeg | cpp | java | c | txt | in | out | exe | o | ico | png)$localhost/tester/sign.php[R=302,L]
//阻止查看.htaccess文件
命令允许,拒绝
全盘否定
//阻止目录列表
选项所有-索引
将.htaccess文件添加到“tester”文件夹后,我得到一个内部服务器错误
服务器遇到内部错误或配置错误,无法完成您的请求
请通过以下地址与服务器管理员联系:wampserver@wampserver.invalid通知他们此错误发生的时间,以及您在此错误之前执行的操作
有关此错误的详细信息,请参阅服务器错误日志
本地主机端口80上的Apache/2.4.23(Win64)PHP/5.6.25服务器
在
.htaccess
中,注释应使用磅符号(#)而不是/
进行注释
#Stop hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost/tester/.*$ [NC]
RewriteRule \.(jpg|jpeg|cpp|java|c|txt|in|out|exe|o|ico|png)$ localhost/tester/signin.php[R=302,L]
#Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
#Prevent directory listings
Options All -Indexes
#停止热链接
重写cond%{HTTP_REFERER}^$
重写cond%{HTTP_REFERER}^http://(www\)?localhost/tester/*$[NC]
重写规则\(jpg | jpeg | cpp | java | c | txt | in | out | exe | o | ico | png)$localhost/tester/sign.php[R=302,L]
#阻止查看.htaccess文件
命令允许,拒绝
全盘否定
#阻止目录列表
选项所有-索引
这适用于我的本地环境。在.htaccess
中,注释应使用磅符号(#)而不是/
进行注释
#Stop hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost/tester/.*$ [NC]
RewriteRule \.(jpg|jpeg|cpp|java|c|txt|in|out|exe|o|ico|png)$ localhost/tester/signin.php[R=302,L]
#Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
#Prevent directory listings
Options All -Indexes
#停止热链接
重写cond%{HTTP_REFERER}^$
重写cond%{HTTP_REFERER}^http://(www\)?localhost/tester/*$[NC]
重写规则\(jpg | jpeg | cpp | java | c | txt | in | out | exe | o | ico | png)$localhost/tester/sign.php[R=302,L]
#阻止查看.htaccess文件
命令允许,拒绝
全盘否定
#阻止目录列表
选项所有-索引
这适用于我的本地环境。还有显示上述错误的online.htaccess验证程序,如。还有显示上述错误的online.htaccess验证程序,如。