一般Wordpress自带的链接是一大串数字加符号,不美观也不明确,一般要设置成固定链接,而设置成功后大部分情况访问文章,子链接都会出现404界面,我找了网上的资料,才知道需要配置伪静态链接, 一般的大型网站系统,都依赖伪静态。如果服务器的伪静态没有配置好,访问部分链接就会出现 404 的情况。
解决方法:
在nginx安装目录找到nginx的配置文件即nginx.conf ,然后进行如下配置就好
location / {
index index.php index.html index.htm;
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;
}
}
rewrite /wp-admin scheme://host$uri/ permanent;
重启nginx:

现在访问文章,子链接就不会出现404界面了。