L Posted January 26, 2008 Share Posted January 26, 2008 Hey I am putting up streaming section on my site, but I don't want people to know the urls of the videos since they can just look them up in the source of the html. Is there anyway I can encrypt them or hide them so no one can see the url? For example like on youtube. Thank you! ~L Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/ Share on other sites More sharing options...
sKunKbad Posted January 26, 2008 Share Posted January 26, 2008 I've seen it done using flash. Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-449390 Share on other sites More sharing options...
L Posted January 26, 2008 Author Share Posted January 26, 2008 I need it done without flash though...would mod rewrite work? I'm not sure how to do it though if possible...like it would rewrite anything like multimedia/video/video1.flv to http://sitewithvideo.com/video/186404.flv RewriteRule multimedia/(.*)/(.*)/ http://sitewithvideo.com/$1/$2& Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-449392 Share on other sites More sharing options...
legohead6 Posted January 26, 2008 Share Posted January 26, 2008 you could make anew page that has an include of the page you want, then you can varify by a get value or something that they are allowed to be there.. and then just chmod the directory all the vids are in to 751 and you will be good. Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-449439 Share on other sites More sharing options...
L Posted January 26, 2008 Author Share Posted January 26, 2008 But that would still display the url to the video in my embed tag even if it is in an include Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-449968 Share on other sites More sharing options...
legohead6 Posted January 26, 2008 Share Posted January 26, 2008 oh, you want to hid it in the source? Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-449969 Share on other sites More sharing options...
resago Posted January 26, 2008 Share Posted January 26, 2008 see if the referer variable is available to rewrite rules. that would keep people from accessing your files except directly from your site. rewrite (*.flv) $_REFERER/$1 or something similar Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-450018 Share on other sites More sharing options...
L Posted January 26, 2008 Author Share Posted January 26, 2008 @resage; so rewrite (*.flv) $_REFERER/$1 will make it so all .flv can only be accessed through my main site? @legohead6 Yah, When I embed it it shows the whole url...so I need to find out how to encrypt it or hide it somehow. Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-450020 Share on other sites More sharing options...
resago Posted January 26, 2008 Share Posted January 26, 2008 yeah, the reference is %{HTTP_REFERER} ReWriteRule ^/stuff/(*.flv) %{HTTP_REFERER}/videos/$1 in your links, you would use /stuff/whatever.flv but you would put the files in /videos this may need some tweaking. there is probably an even better way by simply testing to see if referer is your site. Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-450029 Share on other sites More sharing options...
L Posted January 26, 2008 Author Share Posted January 26, 2008 I'm still experimenting with htacces so this is what I put: ReWriteRule /(*.flv) %{HTTP_REFERER}/multimedia/$1 /(flv) is to mark all the files on the video site /refer/multimeda/ is where the request is coming from which is http://infinitevortex.net/multimedia/video.php?flv=g14.flv and when I put it in it gave me a 500 server error..help? Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-450034 Share on other sites More sharing options...
Lumio Posted January 26, 2008 Share Posted January 26, 2008 I'm still experimenting with htacces so this is what I put: ReWriteRule /(*.flv) %{HTTP_REFERER}/multimedia/$1 ... and when I put it in it gave me a 500 server error..help? try #If you didn't already turned on the RewriteEngine. Otherwise you can leave it out RewriteEngine On RewriteRule /(.+\.flv) %{HTTP_REFERER}/multimedia/$1 Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-450043 Share on other sites More sharing options...
resago Posted January 26, 2008 Share Posted January 26, 2008 this on the otherhand "should" deny any request not from your domain for .flv files. RewriteEngine On RewriteCond %{HTTP_REFERER} !yourdomain\.com/ RewriteRule \.flv [NC,F] Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-450056 Share on other sites More sharing options...
L Posted January 27, 2008 Author Share Posted January 27, 2008 ha, awesome...it worked! And with multiple domains would it just be putting the rewrite two times? RewriteCond %{HTTP_REFERER} !infinitevortex\.net/ RewriteCond %{HTTP_REFERER} !other\.net/ Thanks for everything! Link to comment https://forums.phpfreaks.com/topic/87846-solved-hide-url-from-users/#findComment-450214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.