详细的说明请参考【 http://www.jannn.com/2091.html 】。这里简单的备注下:
CONTENTS
标准方法
进入 conf 文件夹:
cd /usr/local/nginx/conf/
修改 wordpress.conf 文件,在最后添加上一行:
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
保存后,使用下面的命令来测试下修改语法是否OK:
/usr/local/nginx/sbin/nginx -t
最后重启下 nginx 就可以了。
二级域名解决方法
和上述一样,不过添加的内容要改一下,以作者的blog为例,作者的blog是【 cstriker1407.info/blog 】,因此需要在前面加上前缀 blog。
修改后的 wordpress.conf 如下:
location /blog/ { 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 (.*) /blog/index.php; } } rewrite /blog/wp-admin$ $scheme://$host$uri/ permanent;
前缀也可以参考【 http://116.62.110.235/blog/lnmp-pseudo-static-rules-set/ 】
发表评论