I hope this is here to ask for .htaccess files... i have cmoded a few folders 0777 and wonder how i can prevent users from viewing them ? i heard i can do someting with my htaccess file but what ?
Place .htaccess file in the folder you want to deny, then add this in it: The two last lines are only there to allow any user who comes from either the 192.168.2.1 ip or fish.example.com, if you really want to deny to all, just removed the two last lines.
thank you that worked... however.. the folder im trying to block containt .swf files games and on my page when someone now try to view the swf file it wont load... i added my servers IP address that it still didint work.. so in short... how can i make users able to load the .swf file if it's linked in a .php file in /root/ but not able to surf to the folder /root/swf where the file resides.
Hmmm, good question. That I dont know. I hope someone will answer cause I also want to know if possible. Could you: Allow localhost But, im not sure security wise if it is ok. Beware.
You need to restrict directory indexes: http://httpd.apache.org/docs/2.0/mod/core.html#options just put into that directory .htaccess with contents: Options -Indexes Code (markup): PS. Will work only if Apache configured with AllowOverride Options Another way is to put empty index.html into that dir