我想重寫像使用的.htaccess文件以下網址:如何使用.htaccess文件或同等文件從以下URL中刪除「detail.html」?
讓他們爲改寫:
http://www.example.com/haunted_pub
http://www.example.com/haunted_pub/west_and_south_west
http://www.example.com/haunted_pub/west_and_south_west/wiltshire
http://www.example.com/haunted_pub/west_and_south_west/wiltshire/bradford_on_avon
http://www.example.com/haunted_pub/west_and_south_west/wiltshire/bradford_on_avon/6149/the_cross_guns
是否有一個規則,我可以用它來簡單地截斷來自任何URL的最終「detail.html」?如果是這樣,那麼在這種情況下會是什麼?
編輯 這是在IIS下運行。
總之,如果我要求:http://www.example.com/haunted_pub/west_and_south_west然後我希望服務器來渲染http://www.example.com/haunted_pub/west_and_south_west/detail.html但在地址欄中顯示爲http://www.example.com/haunted_pub/west_and_south_west
那是快 - 讓我來試試 – CarneyCode 2014-09-06 10:17:56
http://www.example.com/haunted_pub/west_and_south_west給出了一個500錯誤 - IISPassword:該頁面無法顯示 – CarneyCode 2014-09-06 10:32:07
這是另一個故事,因爲'/ detail.html'被刪除。你當然有一個更好的位置,知道爲什麼這個網址不起作用 – 2014-09-06 10:35:46