Jump to content

show directories


Grendel

Recommended Posts

I think that what you are looking for is the Index Manager in cPanel.

 

Click the link to Index Manager and then click the folder to which the index listing should not be shown. Then select No Indexes then click the Save button.

 

You can still navigate to pages via directly entering them into your address bar, but will not see the directory listing if no default page exists. By default page, I mean index.htm, .html, .php, .shtml, etc. If an index.htm page does exist for a directory, it will show by default.

 

Lianna

Link to comment
Share on other sites

No I tried that and thats not what I am looking for I dont think. If you type in an adderss on my site thats not really there it shows a page that does say index at the top and shows folders which you can click on to move to the files or folders inside. I would like to set the entire site to display "page not found" if you dont have a link or direct path. I know this is a real setting but I dont remember where it is or what its called.

Thx

Link to comment
Share on other sites

What Lianna describes will do exactly what you are looking for. If there is no index.htm or index.html file, etc., the files that ARE in that directory will not be displayed. I can't remember what the error page says, but I know for a fact, that if it is set up correctly, it will not allow the files in that directory to be displayed.

Link to comment
Share on other sites

Simply put an HTML page on the site. Name the page index.htm. Make it say something like "This site is not available for uninvited guests" or something. As long as an index.htm page exists in your root, then the directory index (list of contents) will not display.

 

Lianna

Link to comment
Share on other sites

  • 3 weeks later...

Hi all, I am new, this is my first post.

 

I wanted to turned off the directory browsing, after reading this I put a file index.php on my root folder and it stoped showing the directory. However, I made a folder called 'images' and wanted to turn the directory browsing off here also. I went into the index manager of cpanel to see if there are options to turn it of or not. To my dismay, I found none. All I saw was the folder icons to the left, and nothing else. I tried clicking on it, but no options to turn it off.

 

Also, the web protect feature on the cpanel is the same thing. The pages only shows the folder to the left but no options to password protect the folders. Are these an enhanced features I had to buy???

 

-m

Link to comment
Share on other sites

Thanks, I see the options for the web protect features now. I guess there is a different between clicking on the folders virsus the text links itself. I just had to get used to the navigation system.

 

I like the idea of editing the .htaccess file. Is there a definitive source on this topic. I fould a few on the internet but what does everyone else like?

 

-m

Link to comment
Share on other sites

  • 1 month later...
Do it the old fashioned way, and the best way. 

 

Edit your .htaccess file

 

add this to the top level of the file

 

Options -Indexes

 

No more browsing them directories.

It is a good solution, but is the action applied to the root directory alone, or to ALL directories?

 

If not, how do I do it for all directories?

Link to comment
Share on other sites

The top-level .htaccess applies to all subdirectories unless those subdirectories also

contain .htaccess files that change the settings.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...