Looking for a nginx rewrite rule?
我想大声告诉你
我想大声告诉你 2017-05-16 17:14:41
0
1
521

Want to do a rewrite

Only when the address is http://www.xxxx.com/bbs/, rewrite to http://www.xxx.com/bbs/welcom...
If it is http://www .xxxx.com/bbs/index...or other links under /bbs/ will not be rewritten, and they will still go by

location /bbs/ {

if ( $uri = '/bbs/' ) {
    rewrite ^(.*) http://www.xxx.com/bbs/welcome.html $last
}

}

This is currently written, but http://www.xxx.com/bbs/?a=d and the like will be rewritten accordingly. Can it be rewritten only when the url is in the rules? ? ? ?

我想大声告诉你
我想大声告诉你

reply all(1)
黄舟

Just put the rules of /bbs/index before the rules of /bbs.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template