disable directory indexes with .htaccess

These RFCs were either rejected or have been replaced by an alternative proposal. They will not be included in phpBB.
Post Reply
User avatar
Louis7777
Registered User
Posts: 378
Joined: Fri Apr 04, 2014 12:32 am

disable directory indexes with .htaccess

Post by Louis7777 » Tue Apr 08, 2014 7:53 am

Add Options -Indexes (in a commented line?) to the .htaccess at the root?

It may be of help if you or the user forgets to put in place a blank index file.

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: disable directory indexes with .htaccess

Post by bantu » Fri May 02, 2014 9:09 pm

Probably not a good idea. This will likely produce a 500 HTTP error when "AllowOverride None" is set.

User avatar
Louis7777
Registered User
Posts: 378
Joined: Fri Apr 04, 2014 12:32 am

Re: disable directory indexes with .htaccess

Post by Louis7777 » Fri May 02, 2014 10:26 pm

Hmm you are right I guess.

Well, simply think of whether it would be ok to have it in a commented line preceded by some notes and perhaps a warning (otherwise let's move this to the "rejected" section?).

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: disable directory indexes with .htaccess

Post by bantu » Fri May 02, 2014 10:58 pm

I am sorry, but you are using a hosting setup that has directory listing on by default, you are out of luck. Moving to rejected.

User avatar
mrgtb
Registered User
Posts: 217
Joined: Wed Nov 28, 2007 10:09 pm

Re: disable directory indexes with .htaccess

Post by mrgtb » Fri May 16, 2014 2:57 pm

How comes you don't include an index.htm file in all directories not having an index.php file in them. I was looking through all the directories last night and it's hit an miss which have one, some image directories for instance have one, while some other directories "only having images" in them don't have one included. There are many hundreds of directories now with phpBB 3.1, very unlike phpBB 3.0. Mostly because of the new "phpBB and Vendor" having so many sub-directories - that most have no index.php file in them, yet no blank index.htm file has been included either to stop directory browsing.

It takes hours to add one in directories for phpBB 3.1 (not having an index file already in them), so maybe you should think about including one in them all by default.

If you're saying it can cause issues adding "Options -Indexes" to htaccess to stop directory browsing, then at least do other option. As you can't keep spending "hours each time" adding an index.htm on any full upgrades because none are included by default in directories needing one.

Seriously, I don't mind spending 20 minutes doing it, but it took me about 2 hours doing it last night. So put them in their by default.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1731
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: disable directory indexes with .htaccess

Post by DavidIQ » Fri May 16, 2014 9:29 pm

No it doesn't cause issues adding that but a server that is automatically configured to list directory contents is miss-configured. Apache has this off by default and so does IIS. It is not the job of the phpBB software to ensure the server is set up correctly.
Image

User avatar
VSE
Extension Customisations
Extension Customisations
Posts: 670
Joined: Mon Mar 08, 2010 9:18 am

Re: disable directory indexes with .htaccess

Post by VSE » Fri May 16, 2014 10:23 pm

I guess the question I have then, is if phpBB's directories are hit-n-miss with these index.html files... Should we either make sure they are in all our directories, or remove them from all directories?

I'd be in favor of getting rid of them all, myself... But then I'm used to properly configured quality servers ;)
Has an irascible disposition.

User avatar
mrgtb
Registered User
Posts: 217
Joined: Wed Nov 28, 2007 10:09 pm

Re: disable directory indexes with .htaccess

Post by mrgtb » Sat May 17, 2014 7:38 am

VSE wrote:I guess the question I have then, is if phpBB's directories are hit-n-miss with these index.html files... Should we either make sure they are in all our directories, or remove them from all directories?

I'd be in favor of getting rid of them all, myself... But then I'm used to properly configured quality servers ;)
Well you've missed my point then, which was is doesn't matter if a server is configured correctly or not regarding directory browsing, not if each folder has an index.html file in it needing one.By removing them from all instead, how does that solve anything?
DavidIQ wrote:No it doesn't cause issues adding that but a server that is automatically configured to list directory contents is miss-configured. Apache has this off by default and so does IIS. It is not the job of the phpBB software to ensure the server is set up correctly.
True, it isn't your problem. But how hard is to include one in each folder? Just to be more user friendly across different types of server setups phpBB 3.1 gets used on.

Post Reply