在這裏有一個真正的腦傳情。 一切正常,它應該像,直到我去 mysite.com/index.php?page=XXX & parent_url = XXX & child_url = XXX 後來我得到這個錯誤htaccess重寫規則碰撞
警告:包括(瀏覽/ 12點鐘-bars/cbr-600-f4i.php)[function.include]:未能打開流:沒有這樣的文件或目錄在線167上的/home/leb/public_html/index.php
Warning:include [function.include]:在/ home/leb/public_html/index中打開包含(include_path ='。:/ usr/lib/php')的'browse/12-oclock-bars/cbr-600-f4i.php'失敗.php on line 167
但前兩行工作正常。爲什麼第三行不適用於我的網站。但是,如果我評論前兩行,比第三行更有效......我很困惑。
這是我的HTACCESS文件。任何幫助將不勝感激。
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]
RewriteCond %{REQUEST_URI} !^index.php?
RewriteRule ^(.*)/$ /index.php?page=$1 [L,NC]
RewriteRule ^(.*)/(.*)/$ /index.php?page=$1&parent_url=$2 [L,NC]
RewriteRule ^(.*)/(.*)/(.*)/$ /index.php?page=$1&parent_url=$2&child_url=$3 [L,NC]
--------------------------------------- ---- 用下面的新問題修改
在這裏,第3行將不起作用,但所有其他人都這樣做,如果我上下改變其位置,其他人停止工作。
RewriteRule ^(.*)/(.*)/(.*)/(.*)/$ /index.php?page=$1&parent_url=$2&child_url=$3product=$4 [L,NC]
RewriteRule ^(.*)/(.*)/(.*)/$ /index.php?page=$1&parent_url=$2&child_url=$3 [L,NC]
RewriteRule ^(.*)/(.*)/(.*)/$ /index.php?page=$1&parent_url=$2&product=$3 [L,NC] <---
RewriteRule ^(.*)/(.*)/$ /index.php?page=$1&parent_url=$2 [L,NC]
RewriteRule ^(.*)/$ /index.php?page=$1 [L,NC]
看起來我不得不顛倒我的重寫規則的順序,現在就工作。希望這有助於未來的其他人。 – Dave 2011-05-02 18:11:54
這看起來更像是一個PHP問題,而不是重寫問題。 「瀏覽」目錄不在包含路徑上。導致警告的腳本的絕對位置的位置是什麼? 「瀏覽」的絕對位置是什麼? – outis 2011-05-02 18:12:51
它絕對是一個htaccess的問題。我修改了我原來的帖子..看看列出的第3行 – Dave 2011-05-02 18:42:46