Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I redirect a movie request using .htaccess

Status
Not open for further replies.

Tama

MIS
Jun 6, 2001
121
NZ
Hi there

I have recently added quite a few megabytes of movies to my website. The movies are all sitting in the same directory.

How should I code .htaccess to make sure that people linking to my movies from outside of my domain will get redirected to my website (so I can restrict access if need be to high bandwidth movies.)

For example if someone clicks on: they are redirected to:

I've found a number of posts on this forum that come close to matching what I'm after but I don't have enough experience with htaccess to know I'm doing the right thing.

Cheers
Tama

I do my sums on fingers and thumbs.
 
I'm trying:
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^[URL unfurl="true"]http://(www\.)?vorb.org.nz(/)?.*$[/URL]     [NC]
RewriteRule .*\.(mov|avi|mpg|mpeg|wmv|mp4)$ [URL unfurl="true"]http://www.vorb.org.nz/modules.php?name=Video[/URL] [R,NC]

It blocks the link rather than redirecting it, which is disappointing. I'm guessing that once my local computer picks up the avi file type in the original URL it expects a movie type rather than a webpage. Or is this a problem with my code?

It also seems to allow people to enter the URL into their address bar/ media player - which I'd like to stop as well.

Use this link to test:

Any help/ suggestions etc. is much appreciated.

Cheers
Tama

I do my sums on fingers and thumbs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top