Tang

解决了nginx伪静态问题

参考无数解决方法,最终发现了真正的问题,没有加入文件夹名OTZ

之前的联动文章

编辑配置文件

1
sudo nano /etc/nginx/sites-available/default

找到location,把内容改为下面的句子

1
2
3
4
5
6
7
8
9
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#因为wordpress目录本身在root目录下,在index前增加/wordpress/
try_files $uri $uri/ /wordpress/index.php?q=$uri&$args;
#try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}

重载nginx

1
sudo service nginx reload

成功,刷新主页可以看到自己定义的伪静态页面生效了w

 

参考文献:

 实现 Nginx 支持 WordPress 永久链接

码字很辛苦,转载请注明来自空间中的空间《解决了nginx伪静态问题》

评论