Pseudo-Static solution of WordPress program in LNMP Environment

Source: Internet
Author: User
Tags vps root directory

LNMP environment is currently used in our domestic webmaster Linux VPS Configuration environment used more. As a novice we are likely to see the author similar "Lnmp installation Tutorial" and then according to gourd painting scoop to install the VPS. We have found in the environment we are more commonly used in the WordPress pseudo static does not take effect, the internal page 404 error page. This problem is very good to solve, because we LNMP adopted is nginx, not Apache, so not as direct as Apache throw htaccess file to the site root directory can be effective pseudo static.

First, there are already pseudo static files wordpress.conf files in "/usr/local/nginx/conf/wordpress.conf" in the default installed LNMP environment, and we can check if the compiled code inside is:

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;

}

If not, we need to modify the above code file to rewrite the jump pseudo static.

Second, we need a profile that belongs to our site:

/usr/local/nginx/conf/vhost/www.***.org.conf (automatically name your own domain name)

We'll see code similar to the following, see the thick line Part I added, you can add it to:

server {

Listen 80;

server_name www.***.org;

Index index.html index.php;

Include wordpress.conf;

Finally, we login to the VPS with SSH, and then restart the LNMP with the following command

/ROOT/LNMP restart

After performing the above three steps, we have not solved the pseudo static problem, the other common CMS is the same, in the default conf basically contains the CMS pseudo static compiler script that we need.

Article Source: http://www.laozuo.org/490.html, reprint please indicate the source.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.