要访问示例网站的IP地址,您只需访问
subdomain.example.com
Run Code Online (Sandbox Code Playgroud)
但是,如果我尝试访问
subdomain.2.1.33.111 (example ip)
Run Code Online (Sandbox Code Playgroud)
Firefox返回错误.
为什么?
我正在使用此代码重定向我的用户,阻止浏览器中的 ajax 页面
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {}
else {
header("Location: /");
}
Run Code Online (Sandbox Code Playgroud)
它在 Google chrome、Firefox 26 和 IE11 上运行良好,但是在 Firefox 4 中,即使使用 ajax 加载也会触发标头。
我怎样才能解决这个问题?