TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Tips & Tricks (http://www.talkphp.com/tips-tricks/)
-   -   [How To] Allow / Disallow Directory Browsing (http://www.talkphp.com/tips-tricks/183-how-allow-disallow-directory-browsing.html)

dynaweb 02-21-2007 12:17 AM

[How To] Allow / Disallow Directory Browsing
 
Most servers are configured so that directory browsing is not allowed. This means that if a certain web directory does not contain an index (or default) file, then an error message will be displayed in the web browser.

If Directory Browsing is enabled, then the contents of the directory will be shown in the browser and you can click freely on files and folders therein.

Disllow Directory Browsing
If you want to Disallow Directory Browsing on a server that allows it, create an .htaccess file in the web root directory and add the following line:

Code:

IndexIgnore */*
Allow Directory Browsing
If you want to Allow Directory Browsing on a server that dies nto allow it by default, create an .htaccess file in the web root directory and add the following line:

Code:

Options +Indexes
Remember that .htaccess files do not work on Windows Servers, so you will have to have your web host set the configuration for you. Have fun with your server and htaccess!

mike.fro 02-21-2007 12:17 AM

Very nice. Thanks for your contribution.

Killswitch 02-21-2007 10:49 AM

Thanks, I've always just placed index pages in my directories with little messages in each. This could save me alot of time.

mike.fro 02-21-2007 08:36 PM

Killswitch: A lot of people do that, in fact I used to do that.

Blake 04-14-2009 03:00 AM

Is it possible to configure the page that the visitor sees when they try to browse a directory? I get, for the page title "Index of /(the directory)" and in the body it says "Index of /(the directory)", a server name, my site URL and a port number.

Can I change this to something else?

Village Idiot 04-14-2009 03:49 AM

Quote:

Originally Posted by Blake (Post 23071)
Is it possible to configure the page that the visitor sees when they try to browse a directory? I get, for the page title "Index of /(the directory)" and in the body it says "Index of /(the directory)", a server name, my site URL and a port number.

Can I change this to something else?

In IIS or Apache? In IIS it is in the configuration manager.

ps. This thread is more than 2 years old, you might have wanted to create a new one.

Blake 04-14-2009 12:57 PM

I'm using Apache.

I did realize that, thanks. :-/


All times are GMT. The time now is 03:57 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0