Replaced the VPS, it is necessary to start to move to the site, moving the first problem is the pseudo static WordPress problem. The new VPS uses a LNMP environment and installs the AMH panel. Previously used is the lamp environment Webmin, but the Webmin function is too bloated complex, more memory consumption, and nginx compared to more efficient and stable Apache. So this decision adopts LNMP environment. Although this is more frustrating, but only to toss it will have an unexpected harvest.
NIGNX does not support. htaccess pseudo static rules that need to be modified NIGNX the corresponding configuration file to add pseudo static rules, the following records the entire modification configuration process:
1, log on to the Linux server,
2, open/usr/local/nginx/conf/vhost/"your domain name". Conf,linux commands such as:
Vi/usr/local/nginx/conf/vhost/sufaming.com.conf
3, find
{
Root/Your site path
}
Enter I (insert text command)
Add under it:
Location/{
Index index.html index.php;
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;
}
}
4, and finally press ESC to jump to the command mode, enter: Wq, save the file and Exit VI.
Save after modification ... After the save has not been effective, need SSH link to give
Service Nginx Reload
The order will not take effect.
Universal WordPress Pseudo-static configuration rules
Rewrite ^.*/files/(. *) $/wp-includes/ms-files.php?file=$1 last;
if (!-e $request _filename) {
Rewrite ^.+? (/wp-.*) $ last;
Rewrite ^.+? (/.*\.php) $ $ last;
rewrite ^/index.php last;
}
Another pseudo-static rule for WordPress fixed links under Nginx
It is OK to add a row to the location section of the Nginx configuration file nginx.conf.
1. Open Nginx configuration file:
# vim/etc/nginx/nginx.conf (this path is different from the installation path depending on the Linux version)
2. Add the following lines to the server container
Location/
{
Try_files $uri $uri//index.php?q= $uri & $args;
}
3. reload Nginx configuration file
#/etc/init.d/nginx Reload