开发者

How to disable css access outside from hosting domain?

开发者 https://www.devze.com 2022-12-09 14:31 出处:网络
I\'ve a web app served by Apache, html pages sent to browsers include several CSS files that are hosted at same web app domain.

I've a web app served by Apache, html pages sent to browsers include several CSS files that are hosted at same web app domain.

I've noticed some websites use my css (and images) including in their pages but this increase my (limited) Apache server traffic.

I want to allow css access only for pages hosted at specific domain(s).

How can I configure the web server (Ap开发者_如何学Pythonache) to refuse serving css outside specific domain(s)?

Example (valid access)

myhost.com/index.html contains inclusion for styles/mystyles.css

Example (invalid access)

foreignhost.com/index.html contains inclusion to myhost.com/styles/mystyles.css


Hotlinking can be prevented with .htaccess files, but it might be more fun to change the URL of your CSS files and put up a file at the old URL that makes their entire site hot pink.

0

精彩评论

暂无评论...
验证码 换一张
取 消