2
mod_rewrite規則將index.html
附加到以正斜槓結尾的任何URL會是什麼?該規則應該保留任何查詢字符串。我無法使用DirectoryIndex
指令,因爲index.html
文件並非物理上存在於文件系統中,而是由底層網站框架所需。mod_rewrite添加index.html(如果不存在)的規則
一些示例網址和期望的結果如下所示:
http://example.com/ -> http://example.com/index.html
http://example.com/?a=1 -> http://example.com/index.html?a=1
http://example.com/foo/ -> http://example.com/foo/index.html
http://example.com/foo/?b=2 -> http://example.com/foo/index.html?b=2
http://example.com/foo/index.html -> http://example.com/foo/index.html
http://example.com/foo/index.html?c=3 -> http://example.com/foo/index.html?c=3
我認爲你可以幫助你:http://stackoverflow.com/questions/37407592/configure-htaccess-file-with-two-sites-to-serve – xybrek