设置WordPress二级目录伪静态

常用教程评论3,192 views阅读模式

普通伪静态下,在conf下面写下面的代码

location /
{
	 try_files $uri $uri/ /index.php?$args;
}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

而二级目录伪静态,则需要新加入以下代码:

如果是在宝塔中,只需要网站列表-伪静态-在默认的wordpress代码下加入下面的代码,即可实现二级目录伪静态

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;
}
}

评论  0  访客  0

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定