url-rewrite - nginx rewrite problem
滿天的星座
滿天的星座 2017-05-16 17:26:11
0
1
496

1、abc.com/goods/123
2. abc.com/#/goods/123

Seeking nginx rewrite writing method

Rewrite the first url to the second url.


Added:

First of all, thank you for your answer. There may be some problems with what I described here. abc.com/goods/123 The goods here may be any address,
1. abc.com/xxx/.../...
2. abc.com/#/xxx/.../...

And when rewriting, it is also necessary to determine whether the url is
in 1. If the url is already of type 2, there is no need to rewrite

The logic should be
Determine whether there is ‘#’
in $request_uri or $uri If there is no ‘#’, rewrite will add ‘#’ to

The question here is whether ‘#’ can be obtained through variables such as $request_uri for judgment
No attempts have been successful so far. . .

滿天的星座
滿天的星座

reply all(1)
淡淡烟草味
location ^~ /goods/ {
    rewrite ^/goods/(.*) /#/goods/$1 ;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!