设置WordPress二级目录伪静态

普通伪静态下,在conf下面写下面的代码文章源自原紫番博客-https://www.yuanzifan.com/54628.html

  1. location /
  2. {
  3. try_files $uri $uri/ /index.php?$args;
  4. }
  5.  
  6. rewrite /wp-admin$ $scheme://$host$uri/ permanent;

而二级目录伪静态,则需要新加入以下代码:文章源自原紫番博客-https://www.yuanzifan.com/54628.html

如果是在宝塔中,只需要网站列表-伪静态-在默认的wordpress代码下加入下面的代码,即可实现二级目录伪静态文章源自原紫番博客-https://www.yuanzifan.com/54628.html

  1. location /二级目录名称/ {
  2. index index.html index.php;
  3. if (-f $request_filename/index.html){
  4. rewrite (.*) $1/index.html break;
  5. }
  6. if (-f $request_filename/index.php){
  7. rewrite (.*) $1/index.php;
  8. }
  9. if (!-f $request_filename){
  10. rewrite (.*) /二级目录名称/index.php;
  11. }
  12. }
文章源自原紫番博客-https://www.yuanzifan.com/54628.html文章源自原紫番博客-https://www.yuanzifan.com/54628.html
站长微信
扫码添加(注明来意)
weinxin
Yuanzifan99
原梓番博客公众号
博客内容精选
weinxin
原梓番博客
 

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定

拖动滑块以完成验证
加载中...