WordPress Nginx redirection rules for your own use, suitable for non-subdirectory installation:
Location /{
Try_files $ uri // index. php? $ Args;
}
Rewrite/wp-admin $ scheme: // $ host $ uri/permanent;
AMH comes with the following:
Location /{
If (-f $ request_filename/index.html ){
Rewrite (. *) $1/index.html break;
}
If (-f $ request_filename/index. php ){
Rewrite (. *) $1/index. php;
}
If (! -F $ request_filename ){
Rewrite (. *)/index. php;
}
}
Simple usage: AMH uses the AMRewrite plug-in to create a Rewrite rule, validate the rule, edit the VM, and select the new rule.
Learn more about nginx. conf directly
Another pseudo-static rule for WordPress fixed links in nginx
Add a line in the location section of the nginx configuration file nginx. conf.
1. Open the nginx configuration file:
# Vim/etc/nginx. conf (the path varies depending on the Linux version and the installation path)
2. Add the following lines to the server container:
Location/
{
Try_files $ uri // index. php? Q = $ uri & $ args;
}
3. Reload the nginx configuration file
#/Etc/init. d/nginx reload