views:

33

answers:

1

Edit :
I've got an aspx file (default.aspx) that loads a flash file (index.swf), but this swf needs a xml file (foo.xml) to load correctly. However, I would like to block any request aiming directly at the xml file.

Is it possible, using a rewritting engine (isapi_rewrite for example) to detect if the xml file is being 'hotlinked' or being loaded by the 'index.swf'(inside default.aspx)?

Any ideas?

Thank you.

+1  A: 

you can examine the http referer with RewriteCond %{HTTP_REFERER} ... but remember that some proxies and browsers have this turned off so you'll always get a blank referer.

oedo
Let's say that it can be (;)), how would I do this?
Frank
something like this :`RewriteCond %{http_referer} !^$ [NC, OR]``RewriteCond %{http_referer} !^http://yourdomain.com/index.html$ [NC]``RewriteRule /bar.xml /bar_hotlinked.xml [F]`off the top of my head, might need some tweaking (sorry about formatting)
oedo