如何通过域名屏蔽或网址屏蔽来防止访客访问我们的网站
真实站点示例 http://stackoverflow.com/
URL 屏蔽< /strong> http://masking.com/stackoverflow
问题
如何切换URL屏蔽http://masking.com/stackoverflow< /code> 到原始 URL
http://stackoverflow.com/
让我知道如何用 PHP 或 JavaScript 完成
Example real site http://stackoverflow.com/
URL Masking http://masking.com/stackoverflow
Question
How to switch the URL masking http://masking.com/stackoverflow
to original URL http://stackoverflow.com/
Let me know how can be done in PHP or JavaScript
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
屏蔽网站 URL 是通过框架完成的。您所需要做的就是添加一个断帧脚本。
只需将其添加到您的标题中:
Masking site urls are done with frames. All you need to do is add a frame-breaking script.
Just add this in your header:
我遇到的一种流氓域名屏蔽技术是,多个域名会故意将其 DNS 设置配置为指向我的服务器,这样看起来它们也在托管我的网站。
最初我以为这是通过 iframe 或其他方法完成的,直到我的托管公司确认了真正的原因(他们知道的唯一原因是因为恶意域名也是通过他们购买的,因此他们可以看到其设置)。
要解决此问题,您应该将 Web 服务器配置为拒绝所有不是源自您的域的请求。
在 Apache 2.4 中,这意味着修改 Apache 站点 .conf 文件中的 VirtualHost 设置:
这将允许来自您的域的请求 - 其 www 和非 www 格式。
这将阻止所有其他请求并提供 HTTP 403 Forbidden 响应。请注意,即使使用服务器的直接 IP 地址,Apache 将不再提供服务。
A rogue technique of domain masking I've encountered is where multiple domains will intentionally configure their DNS settings to point to my server, so that it appears they are hosting my website as well.
Originally I thought it was done via an iframe or other method until my hosting company confirmed the real reason (and the only reason they knew is because the malicious domains were also purchased via them so they could see its settings).
To fix this, you should configure your web server to deny all requests that don't originate from your domain.
In Apache 2.4, this mean modifying the VirtualHost settings in your Apache site .conf file:
This will allow requests from your domain - both its www and non-www formats.
This will block all other requests and serve a HTTP 403 Forbidden response. Note that Apache will no longer serve even when using your server's direct IP address.