.htaccess, means Hypertext Access, it is a configuration files used on web-servers. It does many things, one thing you can do with it is to prevent people from browsing your folders.
When people check your-website/folder, they get to know how many files or folders that URL contain, and they can know all the details.
For example, earlier when directory browsing for this site's sub-domain was enabled people could see my files and folders just using http://mrd.myroughdrafts.com/logo/, it listed number of folders and files I made in that directory.
How did I disable that?
I did for domain and sub-domain, I just put up a one line of code in my .htaccess file — this hidden file exists within the root folder of your domain and sub-domain. If you don't see that file, in cPanel of your hosting company, then while clicking on "file manager" don't forget to check "show hidden files," you can also contact the support to know, where that file exists in both your domain and sub-domain.
If you are confirmed by your hosting company that there is no .htaccess file, you can create one — just create a text document and save it by just .htaccess, that's it!
The one line of code
I just pasted the following code at the very top of .htaccess file, and saved the document. And when I checked again http://mrd.myroughdrafts.com/logo/, it returned "403 Permission Denied," that's exactly what I wanted.
Options -Indexes
Comments
Post a Comment