How to protect your folder being accesed by web browsers
Some of you like to put files in the certain folder of your web hosting so that you access it anywhere in the world. However, some of the files are private and you do not want somebody to enjoy it as well. Putting files in a folder, for ex: “privatedata” will make your data accessible in www.yourweb.com/privatedata . Even if you do not tell the link to anyone, some people can just find it in search engine because of their spiders crawling you site.
Put make the folder not accessible, it is simple. You just need to put a simple customized file named “.htaccess” into the folder. The file will then not allowing any browser to view the folder. The file can be only access using FTP or control panel of your hosting. Detailed file is as follows:
- Open your text editor.
- write the following script.
-
AuthType Basic AuthName “Test .htaccess” Require user test
- Save file as “.htaccess”
- Upload the file into the folder of you choice, for ex: “privatedata”. If you hosting is not allowing uploading “.htaccess” file, rename the file into anything and upload. Once uploaded, rename again into “.htaccess”.
- That’s it. Your folder is not accessible anymore by any browsers.
Hope this simple tips can help.
This entry was posted on Tuesday, July 1st, 2008 at 10:11 pm and is filed under featured, sharing. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply