84669인 학습
152542인 학습
20005인 학습
5487인 학습
7821인 학습
359900인 학습
3350인 학습
180660인 학습
48569인 학습
18603인 학습
40936인 학습
1549인 학습
1183인 학습
32909인 학습
我需要把
/module/index.html#/
转成
/index#/
不要前面的module
/module/merchant.html#/
/merchant#/
我写的
rewrite ^/module/index.html(.*)$ /index#/$1;
直接404b
#后面的数据是HTML页面处理的,而不是路由处理的,所以你的重写规则应该是:
#
rewrite ^/module/(.+)\.html$ /$1
就可以了。
你需要做的只是把.html和/module/去掉而已。
.html
/module/
另外,我不知道你是想地址写/module/index.html,来访问/index,还是地址写/index来访问/module/index.html,如果是后者的话,就不是上面那个了,应该是:
/module/index.html
/index
rewrite ^/(.+)$ /module/$1.html
不好意思,服务端拿不到 URL 的 # 后面的数据, 这部分就只能在前端处理。
URL
#
后面的数据是HTML页面处理的,而不是路由处理的,所以你的重写规则应该是:就可以了。
你需要做的只是把
.html
和/module/
去掉而已。另外,我不知道你是想地址写
/module/index.html
,来访问/index
,还是地址写/index
来访问/module/index.html
,如果是后者的话,就不是上面那个了,应该是:不好意思,服务端拿不到
URL
的#
后面的数据, 这部分就只能在前端处理。