Forum Moderators: open

Message Too Old, No Replies

Limiting movie to URL

Want to only allow the movie to be shown on certain URLs/sites

         

vincevincevince

8:29 pm on Feb 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there any way to read either the HTTP_REFERER data or find the actual location the movie is being opened from and refuse to show data (or navigate the browser) if it's not the correct one?

whoisgregg

4:18 am on Feb 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd guess you're attempting to thwart other sites "hotlinking" your flash files, not actually prevent the download or offline use of those movies.

You can set an actionscript to run on the first frame of the movie itself or use it in a preloader to restrict whether or not it loads the actual movie. However all someone must do is download the file and remove this bit of actionscript to be able to host the file on their domain.

You can also set up a apache rewrite rule to do this with the referrer string, but again it only prevents the "hot linking" not the downloading and hosting.

whoisgregg

4:54 am on Feb 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's one way of using actionscript to accomplish this:

LC = new LocalConnection();
if (LC.domain() == 'example.com') {
play();
} else {
getURL("http://www.example.com","_self");
}

This should be the first frame of your movie with the 'example.com' bit changed to your domain. :)

vincevincevince

11:36 pm on Feb 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



whoisgregg,

Thanks so much for that. Just what I needed.