我不是 mod 重写方面的专家。我正在尝试在我的根目录的 .htaccess 中重写多个规则,如下所示:
RewriteEngine On
#HEADER REDIRECTION
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#FINISH HEADER REDIRECTION
#PREVENT IF NOT USER_AGENT
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule .* - [F]
#FINISH PREVENT IF NOT USER_AGENT
#PREVENT UNEXPECTED USER_AGENT STRING
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
RewriteCond %{HTTP_USER_AGENT} ^FlashGet [OR]
RewriteCond %{HTTP_USER_AGENT} ^GetRight [OR]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [OR]
RewriteCond %{HTTP_USER_AGENT} ^aHMView
RewriteRule .* - [F]
#FINISH PREVENT UNEXPECTED USER_AGENT STRING
#BYPASS STRANGERS
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{HTTP_REFERER} !^http://www.site.com [NC]
RewriteRule .* - [F]
#FINISH PYPASS STRANGERS
但规则导致内部服务器错误 500
有什么错误吗?如果是,我应该如何正确写?
谢谢,