Facebook链接到我的网站被解析为403禁止 [英] Facebook links to my site resolve as 403 forbidden

查看:109
本文介绍了Facebook链接到我的网站被解析为403禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个很奇怪的问题.
每当我在Facebook上发布指向我的网站的链接时,它们就会以禁止访问"的形式出现.
该网站本身运行良好,在其他网站上链接时我也没有看到.
这可能是服务器配置错误吗?关于如何看待有什么想法?

Hi I'm experiencing a super weird problem.
Whenever I post links to my website on Facebook, they come up as Forbidden.
The site itself works great and I have no seen this when linking on other sites.
Could this be a server misconfiguration? Any thoughts on where to look?

这是一些信息:
我有运行WHM 11.25.0的专用服务器. 我在这里使用cPanel 11.25.0托管2个站点

here's some Info:
I have a dedicated server running WHM 11.25.0
i have 2 sites hosted here using cPanel 11.25.0

错误消息:

禁止

您没有 允许访问 /blog/deepwater-horizo​​n-11/对此 服务器.

Forbidden

You don't have permission to access /blog/deepwater-horizon-11/ on this server.

另外还有一个404 时遇到未找到错误 试图使用ErrorDocument来 处理请求.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

更新:
如果有帮助,这里是一个示例链接. (注意直接进入链接页面可以正常工作)

UPDATE:
Here is a sample link if it helps. (notice going the linked page directly works fine)
http://www.facebook.com/l.php?u=http%3A%2F%2Fwww.offshoreinjuries.com%2Fblog%2Fdeepwater-horizon-11%2F&h=834ea

更新和答案:
找到了问题,并在下面添加了完整的答案.

UPDATE and ANSWER:
Found the issue and added a complete answer below.

推荐答案

我终于能够深入探究此行为.
我的主机HostGator的默认mod_security设置包括一组白名单和黑名单.检查这些文件后,我发现.facebook.com/l.php已列入黑名单.
l.php是一个包装器页面,它提供警告您即将离开Facebook.据我了解,由于这很容易利用,HostGator选择了将所有出站Facebook链接都列入黑名单.

I was finally able to get to the bottom of this behavior.
The default mod_security settings of my host, HostGator include a set of whitelists and blacklists. Upon inspecting these I found .facebook.com/l.php blacklisted.
l.php is a wrapper page that provides a warning that you are leaving facebook. As I understand it since this can be easily exploited, HostGator chose to essentially blacklist all outbound facebook links.

我通过从mod_security黑名单中删除.facebook.com/l.php解决了我的问题,但是我也可以通过在WHM中单击鼠标,将mod_security设置重置为Default(相对于HostGator配置).

I fixed my problem by removing .facebook.com/l.php from the mod_security blacklist, however I could have also just reset my mod_security settings to Default (vs the HostGator config) via a single click in WHM.

这篇关于Facebook链接到我的网站被解析为403禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆