2012-07-18 46 views
0

上傳後的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] 

感謝

+3

因此,閱讀error.log中,並找出錯誤實際上是。 – Quentin 2012-07-18 11:32:29

+1

而......問題是什麼? (是的,我們可以猜到,但它有助於澄清你想要的幫助。) – 2012-07-18 11:32:30

+0

什麼是錯誤?檢查你的錯誤日誌並添加到你的問題。 – 2012-07-18 11:32:39

回答

0

我已經把完全相同的.htaccess在我的文檔根,併產生你的錯誤。在第一個RewriteRule中逗號後面的標誌之間刪除空格後,錯誤消失。

1

具體來說,重寫引擎對空白不是很聰明,所以無論何時你有空格,它都會假設你有另一個參數。因此,該行的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