Deprecated: Function create_function() is deprecated in /home2/blogwebhostingbu/public_html/wp-content/plugins/facebook-like-box-responsive/facebook-like-box.php on line 29
{"id":1235,"date":"2011-02-04T22:44:20","date_gmt":"2011-02-04T22:44:20","guid":{"rendered":"http:\/\/www.webhostingbuzz.com\/blog\/?p=1235"},"modified":"2011-02-04T22:44:20","modified_gmt":"2011-02-04T22:44:20","slug":"how-to-prevent-directory-indexing","status":"publish","type":"post","link":"https:\/\/blog.webhostingbuzz.com\/2011\/02\/04\/how-to-prevent-directory-indexing\/","title":{"rendered":"How to prevent directory indexing"},"content":{"rendered":"

When accessing a directory (rather than a page) on your site, a visitor will by default see the index page for that directory. If the directory does not contain an index file, the browser will display a list (or index) of the files in that directory.<\/p>\n

For example, browsing to yourdomain.com\/images\/<\/a> would, if there were no index file (such as index.html) display a list of the contents, such as shown in this screenshot:<\/p>\n

\"\"<\/a><\/p>\n

To prevent this directory listing, you can use an .htaccess file (a topic I’ll cover in a future article). If you’re not yet familiar or comfortable working with htaccess, there is a function in cPanel that will take care of it for you.<\/p>\n

In cPanel under the Advanced section, click “Index Manager”. Choose public_html or whatever directory you want to change.<\/p>\n

\"\"<\/a><\/p>\n

Index Manager allows you to customize the way a directory will be viewed on the web. You can select between a default style, no indexes, or two types of indexing. If you do not wish for people to be able to see the files in your directory, choose “no indexing”.<\/p>\n

    \n
  1. Select the directory in which you wish to begin navigating your website’s contents using the pop-up window.<\/li>\n
  2. To navigate Index Manager, click the folder icon next to the directory name.<\/li>\n
  3. Click the name of the directory for which you want to change the indexing style.<\/li>\n
  4. cPanel offers 4 options; select 1 of the following:\n