我需要把
/module/index.html#/
轉成
/index#/
不要前面的module
/module/merchant.html#/
轉成
/merchant#/
我寫的
rewrite ^/module/index.html(.*)$ /index#/;
直接404b
曾经蜡笔没有小新2017-07-03 11:45:09
#
後面的資料是HTML頁面處理的,而不是路由處理的,所以你的重寫規則應該是:
rewrite ^/module/(.+)\.html$ /
就可以了。
你需要做的只是把.html
和/module/
去掉而已。
另外,我不知道你是想寫地址/module/index.html
,來訪問/index
,還是地址寫/index
來訪問/module/index.html
,如果是後者的話,就不是上面那個了,應該是:
rewrite ^/(.+)$ /module/.html