设置WordPress二级目录伪静态

常用教程评论4,127阅读模式

普通伪静态下,在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;
}
}
文章源自原紫番博客-https://www.yuanzifan.com/54628.html文章源自原紫番博客-https://www.yuanzifan.com/54628.html
 

发表评论

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

拖动滑块以完成验证