2012-05-04 183 views

回答

0

是與setthing這一規則做,如果指定了基礎,那麼所有鏈接的基本路徑

RewriteBase/
0

嘗試RewriteRule ^animals/?$ index.php?type=animals

+0

是路徑是否正確? – Simone

+0

該頁面同時在'http:// localhost/animals /'和'http:// localhost/animals'中打開,但當我使用'http:// localhost/animals /'時,css,js文件不會加載。但是使用'http:// localhost/animals'完全適用。 –

+0

@BhaveshGangani你應該編碼你的html,所有對css和js文件的引用(以及其他html頁面的鏈接)對你的項目路徑是絕對的。因此,如果您的網站位於http://www.example.com/,則所有到文件的鏈接都必須是'/ css/style.css'而不是'css/style.css'。如果您的網頁位於http://www.example.com/yoursite/,則所有鏈接都必須如'/ yoursite/css/style.css' –

1

您應該使用L標誌標記結束的規則和QSA來保存新的查詢參數,如下所示:

RewriteRule ^animals/?$ index.php?type=animals [L,QSA,NC] 

NC不用於比較。