hey guys! i want an urgent help from u guys! how do u restrict users from entering a specific directory (eg. www.abc.com/dir/wmv) ... i dnt want anyone to view the wmv sub folder but at the same time i want this folder to run on my site ..i.e i want it to read thru my site but i dnt want it to read if someone goes directly to tht folder.. wht shud i do? i tried the chmod settings... if i change the permissions the folder is directly not readable (thts wht i want) but it is also not readable thru the site(obviously) do u guys have any solution? the question is a bit dumb .. i knw its easy for u guys but im not tht experienced ... pls give me some solution
If it contains php based pages then you can restrict the pages so that it only works if the referrring page is another page on your site. There may be other ways to do it but that is the only one I know. Since some browsers block the referring page and it can be faked, I am not even sure that will work.
Wrap it in a script outside of the wmv directory which simply reads the requested wmv file and outputs it. You can also add some permission checking logic to this script if you like. So now instead of linking to the wmv file directly, you link to the (php/asp/whatever) script. Then add an Apache rule (assuming you're using Apache) to that folder: Deny from all Allow from none so that the directory cannot be accessed via the web.
i did tht... thnx ... i just wanna knw... i have put tht empty index.html file on tht folder... but can anyone download a file from tht directory? u knw if someone knws the file name in tht directory ..then is it possible for him to download tht file? for example >>> http://www.flashgamescript.com/demo/games/WhackABeast.html <<< this link has an .swf file in it... and the link to tht swf file is >>> http://www.flashgamescript.com/demo/files/swf/51695.swf ... now if u see the link of the swf file gives an error msg tht this area is forbidden... so ppl cnt access the swf file directly...coz if thy get the access thy will download the swf file... 1) my question is how can this be done? 2) considering the solution tht u gave (empty index.html page) ... does ur solution also solves the problem of swf being downloaded by someone?
With Mr_2's suggestion if someone knows the file name they can still download the file directly. Do as what I suggested, it should work. If you're unsure about something then ask again in 'Programming' section. This has nothing to do with databases.
If you are on Apache web server, then you can use .htaccess to restrict the direct access. Create a file ".htaccess" in demo/files and put the below content in it. Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http://(www\.)?flashgamescript\.com/ [NC] RewriteRule .*\.(swf)$ http://www.flashgamescript.com/ [NC] Code (markup):