2012-05-14 29 views
0

我的產品網頁位於/product/items/*.html?id=12345 & ref = 54321,我希望網頁顯示爲在根目錄中具有相同的文件名和查詢字符串。HTAccess重寫URL刪除direcotry信息,即根目錄中的網頁

我試圖規則生成和改變我目前的.htaccess的,但沒有什麼似乎頗爲完成任務......

任何幫助感激地接受。

謝謝。

+0

例如www.domain.com/product/items/item1.html讓用戶看到www.domain.com/item1.html – Barton

回答

0

您可能需要使用別名指令嘗試:http://httpd.apache.org/docs/2.0/mod/mod_alias.html

它可以讓你的目錄映射到不同的URL路徑,讓你用Alias /example /product/items通過URL www.domain.com/example/item1.html

我的避風港」訪問/product/items/item1.html噸測試了這一點,但我認爲Alias//product/items將允許您使用www.domain.com/item1.html

+0

感謝您的幫助,我已將它與您的解決方案結合使用。 – Barton