内部错误500 htaccess文件
问题描述:
上传后的htaccess文件我的网站显示内部serever错误500 ...内部错误500 htaccess文件
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中逗号后面的标志之间删除空格后,错误消失。
答
具体来说,重写引擎对空白不是很聪明,所以无论何时你有空格,它都会假设你有另一个参数。因此,该行的htaccess文件中:
RewriteRule (.*) http://deztimes.com/$1 [R=301, L]
重写引擎看到的指令:RewriteRule
中,第一个参数(匹配)(.*)
第二参数(目标)http://deztimes.com/$1
,第三个参数(标志)[R=301,
和第四paramL]
。技术上你可以将多个标志作为单独的参数,但是它们需要用方括号括起来,[]。你有两个标志没有用方括号括起来。这是确定:
RewriteRule (.*) http://deztimes.com/$1 [R=301] [L]
,这是确定:
RewriteRule (.*) http://deztimes.com/$1 [R=301,L]
+0
感谢您的解决方案。下面的代码解决了我的问题。 – 2012-09-05 13:13:08
因此,阅读error.log中,并找出错误实际上是。 – Quentin 2012-07-18 11:32:29
而......问题是什么? (是的,我们可以猜到,但它有助于澄清你想要的帮助。) – 2012-07-18 11:32:30
什么是错误?检查你的错误日志并添加到你的问题。 – 2012-07-18 11:32:39