Jump to content
xisto Community
niran

Disabe Directory Listing

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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:

# This will not show anythingIndexIgnore *#This will not show gif and png images, but will list everything elseIndexIgnore *.gif *.png

Hope that is what you wanted. :)

Share this post


Link to post
Share on other sites

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! :)

Share this post


Link to post
Share on other sites

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 !

Share this post


Link to post
Share on other sites

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. :)vujsa

Share this post


Link to post
Share on other sites

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. :)

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! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.