PDA

View Full Version : Htaccess and videos


luke
06-25-2003, 10:46 AM
I'm setting up a bunch of video content underneath one domain and we're trying to use htaccess to allow only certain domains to access it. But when we tried to link to the wmv windows media player opened up and says the file was corrupt. But as soon as we delete the htaccess file, it plays just fine.

Can anyone help?

CX*
06-25-2003, 12:22 PM
I have had this problem myself and the great guys at Xamo helped me figure it out...
instead of using the htaccess to list the sites that you are allowing to view the material..
I just had a folder in a website that wasn't taking members hold all my content... if your doing this too.. just make an htpasswd file and create a user and pass.. then read the following :: If this is not what you mean or you need more help let me know ....



When you link to the shared area, just use a link such as:

password@sharedcontentarea.com>http://username:password@sharedcontentarea.com

That should allow you to protect it and only allow authenticated users access to this area.

Ronaldo
06-25-2003, 12:41 PM
If that advice doesn't help you Luke, drop an email to mike@xamo.com or hit him up on icq-9439118.

luke
06-25-2003, 01:03 PM
Yeah, but then you have that user/pass that someone could link to or share.

We found a couple things we're gonna try out today.
http://www.21code.com/alfgate/index.php
http://www.hotlinkprotector.com

Thanks.

xamoMike
06-25-2003, 01:19 PM
Luke,

the problem is that when you use windows media player, it doesnt send the referring URL, so your htacces (mod_rewrite?) code won't work, because your referring URL is blank.

Another solution, is the one colette mentioned. The trick here though is to change the username and password every 5-10 minutes using a script, you could write one in PHP (or have it done for you). That way if your username/password got handed out, its only good for 10 minutes.

The only final way to do it, is the way we do it, and sorry I can't devulge that yet! It's still experimental, but seems to get around all current problems with the type of security needed here. Of course its also harder to implement. :bonk: Hope it helps!

CX*
06-25-2003, 01:23 PM
Mike is the one who told me how to do this... although it didn't work for my problem since im using a php script to serve all the photos and media. I do know quite a few people who are having the same problem and one of them wrote their own script in php to get it to work..

Mike you are the man!!!

xamoMike
06-25-2003, 01:25 PM
wow fast post.. thanks Colette! Anytime you need PHP help, you know who to bang over the head!!!

luke
06-25-2003, 01:43 PM
Thanks yall. I will let you know if what we found works or not.