Wordpress 主题出现 502 代理错误 - 代理服务器无法处理请求 GET /check
我刚刚完成创建我自己的 WordPress 主题。但是当我通过 validator.w3.com 检查 html 验证时,得到:
502 Proxy Error 代理服务器从上游服务器收到无效响应。 代理服务器无法处理请求 GET /check。
原因:从远程服务器读取时出错。 Apache/2 服务器位于 validator.w3.org 端口 80
是什么意思?据我所知,我不使用任何代理服务器。
----- 编辑: -----
看起来问题出在functions.php中:
if(isset($_GET['page']) && $_GET['page']=='admin-functions.php'){
**codes here***
}
如果我删除 if(isset($_GET['page']) && $_GET['page']= ='admin-functions.php'),它不会返回 502 代理错误。我应该如何修复此代码才能通过 w3 验证器?
非常感谢!
----- 编辑:-----
哦,好吧,显然这不是问题。即使我删除 if(isset($_GET['page']) && $_GET['page']=='admin-functions.php') ,它有时会返回 502 错误,但有时不会。我真的不明白这个想法。
-----找到了解决方案!-----
叫我傻瓜!
我发现了问题: 我使用这些 DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
然后我删除了所有这些并更改为:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
现在工作正常
I just finished create my own wordpress theme. But when I checked the html validation through validator.w3.com, it got:
502 Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /check.
Reason: Error reading from remote server.
Apache/2 Server at validator.w3.org Port 80
What does it mean? As far as I know, I don't play around using any proxy server.
----- EDIT: -----
Looks like the problem is in functions.php:
if(isset($_GET['page']) && $_GET['page']=='admin-functions.php'){
**codes here***
}
If I remove the if(isset($_GET['page']) && $_GET['page']=='admin-functions.php'), it returns no 502 proxy error. How should I fix this code to get through the w3 validator?
Many thanks!
----- EDIT: -----
oh well, apparently it's not the problem. Even if I remove the if(isset($_GET['page']) && $_GET['page']=='admin-functions.php'), it sometimes returns 502 error, but sometimes not. I really don't get the idea.
-----FOUND THE SOLUTION!-----
call me stupid!
I found the problem:
I use these DOCTYPEs:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
then I erased all of them and change to :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Works fine now
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了问题:
我使用这些 DOCTYPE:
然后我删除了所有这些并更改为:
现在工作正常
I found the problem:
I use these DOCTYPEs:
then I erased all of them and change to :
Works fine now