有些刚用上AMH的博友应该有遇到这个问题,AMH后台有个默认wordpress伪静态规则,一般情况下都是可以用的,
但是有时候却出现进wordpress后台404错误
下面给出解决方法:
location / {
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;
}
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
这个代码就是在amh默认的wp规则上在最后面加了一句:
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
如果问题还是没有解决的话可以试试nginx官方给的wordpress伪静态规则:
location / {
# This is cool because no php is touched for static content.
# include the "?$args" part so non-default permalinks doesn't break when using query string
try_files $uri $uri/ /index.php?$args;
}

评论(0)
暂无评论