Last update at :2024-06-12,Edit by888u
Today, Snail is moving a website from a virtual host to a vps host. Because before, the root directory and the secondary directory in the virtual host each had a blog website built by the wordpress program. In the VPS host I am currently using, I use the LNMP one-click installation package, if I am not afraid of the trouble of reinstalling the system. According to my own familiarity, I should use llsmp or mapn to install the package with one click. Of course, this does not mean that lnmp is not good. The main reason is that nginx has pseudo-static settings and some settings are too troublesome. Novices are advised not to use it.
Getting back to the subject, in the article "Pseudo-static Solution for WordPress Program in LNMP Environment", Snail has already shared how to make WordPress perfectly use pseudo-static settings, which all need to be set manually, while apache is automatic. However, when you need to install wp in the secondary directory, you will find a 404 article page error, which must be a problem that needs to be adjusted. So we find the \\"/usr/local/nginx/conf/wordpress.conf\\" file and add:
location /laozuo/ {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 (.*) /laozuo/index.php;}}
Note that the two laozuo directories need to be changed to the names of your secondary directory folders. Then we restart lnmp and it will take effect.
Recommended site searches: server proxy IP, 100m free space, IP address query, server space rental, Ministry of Industry and Information Technology ICP registration query, virtual host evaluation, registration-free domain name, US imitation brand space, US host, com domain name registration,
p>
发表评论