How reseller or VPS can change directory indexing default
Posted on 08 Feb 2011 by Alan Burns
A few days ago I explained how to use cPanel’s Index Manager function to prevent or alter directory indexing. Today I’ll tell you how a reseller or VPS (Virtual Private Server) hosting account can change this default for all new cPanel accounts.
Reseller
- First, create a text file. In that text file, paste the following line:
Options -Indexes
- Save that text file as “.htaccess”.
If your text editor won’t let you choose that filename, save it as htaccess.txt. Then, in your file explorer select that file icon and change the filename to “.htaccess”. If your system still won’t allow that, then leave it as is and change the filename after you upload the file to your web hosting account.
- Create a /public_html directory within your skeleton directory. (If you followed my instructions in my earlier article to create a default web page, then this directory already exists.
- Upload the .htaccess file to /cpanel3-skel/public_html.
Any newly-created cPanel account I create will now have directory indexing disabled for all web directories. If the new cPanel account holder wants a different setting, he/she may use cPanel’s Index Manager function to enable directory indexing.
VPS
VPS accounts have a higher level of control than resellers, and can make server config changes. A VPS account can change the default for directory indexing to disabled.
- Login to VPS as root.
- Service Configuration > Apache Configuration > Global Configuration.
- Under “Directory ‘/’ Options” uncheck “Indexes”.
This disables directory indexing for all accounts under the VPS. If a cPanel account holder wants a different setting, he/she may use cPanel’s Index Manager function to enable directory indexing.
How to prevent directory indexing
04 Feb 2011 by Alan Burns
cPanel feature frustrates users
15 Feb 2011 by Alan Burns