Nov 22, 2009

Disabe Directory Listing

free web hosting
Open Discussion & Free Web Hosting > Astahost > Hosted Members Support

Disabe Directory Listing

Niran
Hi all,
How can I disable directory listing?
That means, if there is no default page for that directory,
that should display access denied page!
How can I configure that using cPanel?

Comment/Reply (w/o sign-up)

Quatrux
This is really easy.. I don't know if you can do it in CPanel, but you just need to create a htaccess file in the directory you wish to not list the files with this code:

CODE

# This will not show anything
IndexIgnore *
#This will not show gif and png images, but will list everything else
IndexIgnore *.gif *.png


Hope that is what you wanted. wink.gif

Comment/Reply (w/o sign-up)

Mark420
I guess you should make a copy of this file and drop into every directory...cos if there is a page there it will see it..if not it display an error403 right?

Comment/Reply (w/o sign-up)

Niran
after putting that .htaccess file in the directory "files"
Its showing like this

But what I need to show something like 403 Error page like this
( here simply copied 403.shtml file to the directory and renamed it as index.html )

I dont want to display 403 error by copying that page in all the directories!
All I need to show one 403 error page If there is no default page in the directory!

( My previous hosting server automatically disables the directory listing and will show the 403.shtml page if there is no default page to display! )


I need to do like that! Is there any other method my dear friends! biggrin.gif

 

 

 


Comment/Reply (w/o sign-up)

Mark420
Remember the custom error page thread?

go back to it and follow what I did...I think this is the answer;)

Comment/Reply (w/o sign-up)

yordan
QUOTE
Remember the custom error page thread?

My thread ? Yes, I remember it. And, yes, looks exactly what Niran wants to do. And, yes, the explanations were so clear that I will try using them to do my own 403, 404 error pages as soon as I will leave today !

Comment/Reply (w/o sign-up)

jlhaslip
Silly suggestion, maybe, but add an index.html. Maybe even an index.php with a re-direct to the 403 page?

Comment/Reply (w/o sign-up)

vujsa
Wow, so much disucussion about such a simple thing:
goto cPanel > Index Manager

This will give a error 403 Forbidden if there isn't an index.*** available.

The other option is to just put an index.html/php/asp/ext in each directory with no data in it. This will display a blank page if the directory is acessed without a page specified.

Hope This Helps. cool.gif

vujsa

Comment/Reply (w/o sign-up)

Niran
QUOTE(vujsa @ Sep 22 2006, 08:51 AM) *

Wow, so much disucussion about such a simple thing:
goto cPanel > Index Manager

This will give a error 403 Forbidden if there isn't an index.*** available.

The other option is to just put an index.html/php/asp/ext in each directory with no data in it. This will display a blank page if the directory is acessed without a page specified.

Hope This Helps. cool.gif

vujsa



Hey,
thats great dude!
That method is working!
Now showing the forbidden message by disabling the index for my images folder!
Thanks a lot friend!
I'm a newbie to the cPanel! so I was not much aware of those functions in cPanel!
thank you very much friend! biggrin.gif

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)


See Also,

*SIMILAR VIDEOS*
Searching Video's for disabe, directory, listing
advertisement



Disabe Directory Listing

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com