Pseudo-static - nginx rules help
天蓬老师
天蓬老师 2017-05-16 17:23:22
0
2
500

There is now a website that uses Baidu siteapp automatic transcoding service. Now it has developed its own mobile terminal. However, before, Baidu used automatic jumps to access the mobile terminal.

The current problem is how to make the previous access link automatically jump to the new link.

The transcoding link of Baidu siteapp is:
http://m.xxx.com/?src=http://www.xxx.com/north-america/america/2010/05...

Replace this part http://m.xxx.com/?src=http://www.xxx.com/ with http://m.xxx.com/

through nginx rules

In this way, when users search for the content of this site through m.baidu.com, they can jump directly from the old url to the new url.

Can the above replacement function be implemented through nginx rules? Please help me heroes. Many thanks.

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(2)
黄舟
nginxserver {
    server_name m.xxx.com;
    location / {
        if ($args ~* "src=.*$") {
            rewrite ^ $arg_src? permanent;
        }
    }
}
習慣沉默

The test was successful, thank you for your help!

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