1

I want to restrict access to a flash movie so it can only be loaded from a certain url. That url is a page on my server which can only be accessed after you get a pass code. What I don't want is someone who has a pass code scanning the page html source to find the flash movie url and publishing it so everybody can see the file.

Say the page is: http://www.mydomain.com/you_have_a_code.php and the flash movie is: http://www.mydomain.com/movies/movie.swf

I dont' really care if someone steals the flash movie from the cache and publishes it on another website, that's kind of impossible to avoid. What really bothers me is that someone publishes the second link and then people can access the flash movie indiscriminately, on my own server, without having a pass code.

Can that be achieved with the .htaccess file? how?

Pol
  • 13

1 Answers1

2

Try something like this. It requires mod_rewrite, of course.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www\.mydomain\.com [NC]
RewriteRule ^movies/movie.swf$ - [F,L]

Also, try this community wiki: Redirect, Change URLs or Redirect HTTP to HTTPS in Apache - Everything You Ever Wanted to Know About Mod_Rewrite Rules but Were Afraid to Ask

References:

http://httpd.apache.org/docs/current/mod/mod_rewrite.html

http://dmr.ath.cx/notes/rewrite.html

http://www.webmasterworld.com/forum92/3229.htm

http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html