Pseudo-static details of Nginx server rewrite

During the migration process to a new host, the biggest difficulty is the setup of WP permalink rewrite. Because the old host is using Apache, The .htaccess that can be changed by WP itself is used without too much difficulty. This time, Nginx is running on VPS, mainly because Nginx is much faster than Apache. But on the other hand, it is not so comfortable, because Nginx’s rewrite is different from Apache, and it can only be changed on the server. The following are some research notes during the period. (The following examples are taken from nginx wiki unless otherwise specified) /1 Nginx rewrite basic syntax The rewrite syntax of Nginx is actually very simple. The instructions used are nothing more than these set if return break rewrite Although the sparrow is small, it has all internal organs. Just a few simple instructions can make a simple and flexible configuration that is absolutely not inferior to apache. 1.set set is mainly used to set variables, nothing special 2.if if is mainly used to judge some conditions that cannot be directly matched in the rewrite statement, such as detecting whether a file exists or not, http header, COOKIE, etc., Usage: if(condition)…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索