htaccess文件出现内部错误500


internal error 500 with htaccess file

上传htaccess文件后,我的网站显示内部serever错误500…

RewriteEngine On
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^deztimes'.com
RewriteRule (.*) http://deztimes.com/$1 [R=301, L] 
RewriteRule ^([^/]*)'.html$ /index.php?tag=$1 [L]
RewriteRule ^do/([^/]*)/post/([^/]*)/size/([^/]*)/status/([^/]*)/([^/]*)'.jpg$ /index.php?do=$1&post=$2&size=$3&status=$4&title=$5 [L]
RewriteRule ^do/([^/]*)/post/([^/]*)/([^/]*)'.jpg$ /index.php?do=$1&post=$2&title=$3 [L]
RewriteRule ^do/([^/]*)/size/([^/]*)/status/([^/]*)/id/([^/]*)/([^/]*)'.jpg$ /?do=$1&size=$2&status=$3&id=$4&tite=$5 [L]
RewriteRule ^do/([^/]*)/id/([^/]*)/([^/]*)'.jpg$ /?do=$1&id=$2&title=$3 [L]
RewriteRule ^do/([^/]*)/image/([^/]*)/size/([^/]*)/status/([^/]*)/([^/]*)'.jpg$ /index.php?do=$1&image=$2&size=$3&status=$4&title=$5 [L]
RewriteRule ^do/([^/]*)/image/([^/]*)/([^/]*)'.jpg$ /index.php?do=$1&image=$2&title=$3 [L]
RewriteRule ^do/([^/]*)/height/([^/]*)/id/([^/]*)/([^/]*)'.jpg$ /index.php?do=$1&height=$2&id=$3&title=$4 [L]
RewriteRule ^do/([^/]*)/id/([^/]*)/([^/]*)'.jpg$ /index.php?do=$1&id=$2&title=$3 [L]
RewriteRule ^post/([^/]*)/([^/]*)'.html$ /?post=$1&title=$2 [L]

感谢

具体来说,重写引擎对空白并不那么聪明,所以每当你有空格时,它都会假设你有另一个参数。所以你的htaccess文件的这一行:

RewriteRule (.*) http://deztimes.com/$1 [R=301, L] 

重写引擎看到指令:RewriteRule、第一个参数(匹配)(.*)、第二个参数(目标)http://deztimes.com/$1、第三个参数(标志)[R=301,和第四个参数L]。从技术上讲,您可以将多个标志作为单独的参数,但它们需要用方括号[]括起来。您拥有的2个标志没有用方括号括起来。这没问题:

RewriteRule (.*) http://deztimes.com/$1 [R=301] [L] 

这是可以的:

RewriteRule (.*) http://deztimes.com/$1 [R=301,L] 

我在我的docroot中放入了完全相同的.htaccess,并产生了您的错误。在第一次重写规则中删除逗号后标志之间的空格后,错误就消失了。