Last update at :2023-12-27,Edit by888u
WordPress is still one of the most used blogging programs, used by both novices and veterans. After all, rich resources are hard to come by. Compared with other programs, WordPress does take up more resources, but now generally VPS hosts for website building have at least 1G of memory, which can still be supported relatively well! In fact, sometimes insufficient resources are mostly caused by plug-ins or templates, or it may also be caused by overbooking of resources by the host provider. Now let’s talk about how to set the secondary directory pseudo-static in the LNMP environment under the Linux system.
Currently, the environment built using the LNMP one-click installation package in the VPS host does not have rules for secondary directories. The specific modification process is as follows:
Find the "/usr/local/nginx/conf/wordpress.conf" file on your host and add the following content:
- location /thissite.com/ {
- 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 (.*) /this site.com/index.php;
- }
- }
Explain that the .com directory of this website in the above code must be changed to the name of the secondary directory folder in your own website.
Finally restarting lnmp solved the problem and the website returned to normal.
Reminder: Before adding the pseudo-static secondary directory, please back up your original data, preferably the entire file, just in case; please be careful when modifying, there may be some People can succeed, and some cannot. This site also backed up the data when adding some. After all, the data is important. Even if the hosting provider goes bankrupt or runs away that day, as long as the data can be restored immediately.
Recommended site search: Server Hong Kong, Ministry of Industry and Information Technology domain name registration, free ip proxy server, foreign free asp space, free virtual host, website registration domain name query, broadband ip address query, cloud server rental platform, Alibaba Cloud domain name registration, domain name purchase ,
发表评论