Hello:
I setup the mod_rewrite to protect the albums folder and it works fine with all picture files: I can browse the gallery without problem, I can't download the image directly (which is what I wnat), etc.. But I had problem for the video files. When I click on the movie icon, WindowsMediaPlayer popup and can't play the file. I can't do 'right click - save target as' routine because the rewrite protection. Is there anyway to get around it?
Thanks.
Posts: 33
Can anyone help me?
Posts: 7994
What's the URL to your Gallery, and what rewrite rules did you use?
Posts: 33
I am testing it on a local machine (FreeBSD). Here is the .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://www.homedomain.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://homedomain.com/ [NC]
RewriteRule /* - [F]
</IfModule>
It works for all the image files. But when I click on a video file, the Windows MediaPlayer popup and can't retreive the file. I suppose WMP just like the "Save As..." command that has no referral. And idea?
Thanks for your reply.
Posts: 7994
I still need the URL to your Gallery.
Also, does everything work correctly if you remove the .htaccess rewrite protection?
Posts: 33
If I removed the .htaccess, everything is fine. I can download the movie and the MediaPlayer plays it fine.
The site contains adult pictures, will it be fine to post the url here? thanks.
Posts: 7994
Sure, it's fine with me.
Posts: 33
<!-- BBCode Start --><A HREF="http://www.eroticwebshots.com/gallery/modules.php?set_albumName=album48&op=modload&name=Gallery&file=index&include=view_album.php" TARGET="_blank">Here</A><!-- BBCode End --> is the direct link to the album with one video file. Please use test/test to <!-- BBCode Start --><A HREF="http://www.eroticwebshots.com/gallery/modules.php?name=Your_Account" TARGET="_blank">login</A><!-- BBCode End --> the phpNuke first. Currently, the rewrite engine is on. You can view all the picture files fine. Only the video file has problem.
The site is not live now. So don't be surprised if you see broken thumbs on the front page. I am testing the mySQL mod by Richard Benfield. Obviously there is a bug about creating thumb info. I don't have time to check the source yet.
The gallery is embedded in phpNuke and it's pretty slow. Although the server isn't a fast one (PIII933, 512MB ram), but it's still slow to me (I have php accelerator installed). I don't if the server can hold after I pump 10,000 visitors to it. Maybe phpNuke isn't a good way to make large site? If you know any trick to improve the performance, please be sure to let me know. Thank you.
Posts: 7994
Ok, I can see the problem happening. I sniffed the packet traffic and verified your hypothesis: WMP is not sending the "Referer" HTTP header.
Unfortunately, I don't have an easy solution for this. You could search the Customization forum to see if anybody has implemented a real image firewall, you could write one yourself, or you could change your .htaccess to ignore .wmv files (leaving a back door to your movies).
G2 does this the right way -- your data doesn't live in the webserver root. It's accessible only via a script which checks all permissions. But G2 is still pre-alpha and won't be ready to use in a production environment for at least 4 months.
Posts: 33
I figure the G2 will be the best solution. For now, I may write another script to deliver the video files. Thanks for your help. I was just wondering if I did something wrong.