niran 0 Report post Posted September 21, 2006 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
Quatrux 4 Report post Posted September 21, 2006 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
Markymark2 0 Report post Posted September 21, 2006 (edited) 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? Edited September 21, 2006 by Mark420 (see edit history) Share this post Link to post Share on other sites
niran 0 Report post Posted September 21, 2006 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
Markymark2 0 Report post Posted September 21, 2006 (edited) Remember the custom error page thread?go back to it and follow what I did...I think this is the answer;) Edited September 21, 2006 by Mark420 (see edit history) Share this post Link to post Share on other sites
yordan 10 Report post Posted September 21, 2006 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
iGuest 3 Report post Posted September 22, 2006 Silly suggestion, maybe, but add an index.html. Maybe even an index.php with a re-direct to the 403 page? Share this post Link to post Share on other sites
vujsa 0 Report post Posted September 22, 2006 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
niran 0 Report post Posted September 22, 2006 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