tags:

views:

23

answers:

1

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 (Apache) 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

+3  A: 

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.

ceejayoz
That is a devious suggestion worthy of 200 points.
Vincent Ramdhanie