【问题标题】:How to disable css access outside from hosting domain?如何禁用托管域外部的 css 访问?
【发布时间】:2009-10-24 15:34:54
【问题描述】:

我有一个由 Apache 提供的网络应用程序,发送到浏览器的 html 页面包含多个托管在同一网络应用程序域中的 CSS 文件。

我注意到一些网站使用我的 CSS(和图像),包括在他们的页面中,但这增加了我的(有限的)Apache 服务器流量。

我希望仅允许对特定域中托管的页面进行 css 访问。

如何配置 Web 服务器 (Apache) 以拒绝在特定域之外提供 css?

示例(有效访问)

myhost.com/index.html 包含样式/mystyles.css

示例(无效访问)

foreignhost.com/index.html 包含对 myhost.com/styles/mystyles.css 的包含

【问题讨论】:

    标签: apache


    【解决方案1】:

    Hotlinking can be prevented with .htaccess files,但更改 CSS 文件的 URL 并在旧 URL 上放置一个文件可能会更有趣,这会使整个网站变成粉红色。

    【讨论】:

      猜你喜欢
      • 2020-06-03
      • 1970-01-01
      • 1970-01-01
      • 2017-04-15
      • 1970-01-01
      • 1970-01-01
      • 2013-01-02
      • 1970-01-01
      • 2013-10-21
      相关资源
      最近更新 更多