default index

Avatar
  • Answered
How do i set the default directory index as no index?

========
#1 mrbi11 2012-01-30 15:13
So is there no way to change the default behavior?

In general, I do not want everyone to be able to see inside all my directories. There may be specific cases where I want to allow this.

The "cpanel" "index manager" allows me to override the default on each directory, but if i create a hundred directories apparently (from testing) i would have to do this 100 times. Worse, I have to remember to set this each new directory ever created. Testing shows it is not inherited from the root folder, as one might hope. Any dynamically created directories can not be handled unless i can set the default.

I would like to set the default to off (safe), not disable it on all my web sites.
I may want to use the index manager to enable it on a case by case basis.

As I said, how do i change the default behavior, and still allow the functionality to be enabled for specific directories?
Quote
Avatar
Tim S.
Hi mrbi11,

Thanks for getting back to us. Index manager, will stop a directory listing for that specific folder. This does not stop error messages from being displayed. However, it's my understanding if you block the public_html folder from displaying the directory index, it will stop any folders within that folder from displaying the indexing as well. Then any folder you want to turn indexing on - you could simply choose the method in the index manager. I've tested it out on my test account, and it functions this way.

So, you can set the public_html folder to no indexing. This blocks all folders within it. Then any folder you wish to grant the indexing privilege to, you'd go into index manager and set.

I hope I explained this adequately. If you need further assistance please feel free to contact us.

Thanks!

Tim S
Avatar
Tim S.

Hi mrbi11,


Thanks for posting your question. I'm more than happy to assist you. I'm having some trouble understanding what you want to accomplish, so I'll try to cover a few topics.


If you are trying to keep search bots from indexing your website, so it does not show up in the search results we have a good tutorial on it:


Using a robots.txt file to limit bots from crawling your site


If you want to change the default file types of what displays when someone types your domain name, then you can do the following:


Inside the .htaccess file, put a single line beginning with DirectoryIndex followed by the list of filenames that you want Apache to serve first when a directory has been requested. For example:


DirectoryIndex index.phtml start.html


To disable a directory index from being diplayed when a visitor visits your website you'll want to disable indexing. This can be done by adding the following line to your .htaccess file.


Options -Indexes


If you need further assistance please feel free to contact us.


Thanks!

Tim S