普通伪静态下,在conf下面写下面的代码文章源自原紫番博客-https://www.yuanzifan.com/54628.html
- location /
- {
- try_files $uri $uri/ /index.php?$args;
- }
- rewrite /wp-admin$ $scheme://$host$uri/ permanent;
而二级目录伪静态,则需要新加入以下代码:文章源自原紫番博客-https://www.yuanzifan.com/54628.html
如果是在宝塔中,只需要网站列表-伪静态-在默认的wordpress代码下加入下面的代码,即可实现二级目录伪静态文章源自原紫番博客-https://www.yuanzifan.com/54628.html
- location /二级目录名称/ {
- 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 (.*) /二级目录名称/index.php;
- }
- }
站长微信
扫码添加(注明来意)

Yuanzifan99
原梓番博客公众号
博客内容精选

原梓番博客
评论