产品服务AMH 免费服务器主机面板SSL证书 免费SSL证书申请编程助手免费智能写代码、翻译NewAMYSQL 免费MySQL管理工具AMFTP 免费FTP管理客户端

AMH 社区首页

 AMH社区 - 开放自由有价值的社区

[综合话题] 求助(wordpress设置固定链接后404)我的环境是nginx,规则是控制面板自带的wordpress的规则

fzpying
铁牌会员
29.09 价值分

fzpying 发表于 2017-01-10 11:08:49
求助(wordpress设置固定链接后404)我的环境是nginx,规则是控制面板自带的wordpress的规则
评价: 这个话题有价值吗?  没有 (0分)   有, 感谢 (0分)
2017-01-10 11:08:49 1

playabby
铝牌会员
351.69 价值分

wordpress规则里最后加一行
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
评价: 这个回复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2017-01-10 14:32:09 2

fzpying
铁牌会员
29.09 价值分

引用:
playabby 发表于 2017-01-10 14:32:09
wordpress规则里最后加一行
rewrite /wp-admin$ $scheme://$host$uri/ permanent;



我试了还是不行呢!

我的是这样的哦!
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;
}
if ($server_port = 80) {
return 301 https://$host$request_uri;
}
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
}
评价: 这个回复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2017-01-10 20:09:46 3

playabby
铝牌会员
351.69 价值分

AMH官方规则加我的最后一行
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;
评价: 这个回复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2017-01-11 08:52:04 4

playabby
铝牌会员
351.69 价值分

if ($server_port = 80) {
return 301 https://$host$request_uri;
}
if ($scheme = http) {
return 301 https://$server_name$request_uri;

你这个加了2个重定向啊,去了吧。先解决网站访问问题,再解决重定向问题
评价: 这个回复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2017-01-11 08:53:03 5

playabby
铝牌会员
351.69 价值分

重定向可以参考这位同学的帖子
http://amh.sh/bbs/post-4986-1-1.htm
评价: 这个回复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2017-01-11 08:55:23 6

hongxw
铁牌会员
9.86 价值分

郁闷,我原本也可以做了,想再加一个域名备案,搞得现在所有域名不能用,都要重新备案。见鬼
评价: 这个回复有价值吗?  没有 (0分)   有, 感谢 (0分)
回复  2017-01-13 16:06:50 7
 1  (总1页)
AMH社区列表
用户服务中心