Msg#: 4403151 posted 12:49 pm on Jan 3, 2012 (gmt 0)
Before I go ahead and try and implement this, what is the correct use of “AllowOverride None”?
I picked up a text book over the holidays which suggests that “AllowOverride None” should be in the main root htaccess file to improve performance and then use a <Directory> directive, again in the main root htaccess to allow other directories.
If nothing filters down from the root (where most of the configurations are) unless overridden with a <Directory> directive this would mean (for me) every Directory would need to be separately enabled?
For example, the server I am testing on has the default set as “AllowOverride All”. If I change this to “None”, I immediately lose configurations such as Options –Indexes for sub-directories which now have a folder index rather than their DirectoryIndex page?
As a general rule is it not the best principal to put as much as possible in the root htaccess? No doubt I misunderstand the use of this but I would be grateful for some feedback.
(fragment link "allowoverride" will be eaten by the Forums, but it's near the top). Your options-- haha-- are not limited to "All" or "None". You can list Override permissions individually.
If it's your own server, then you should be putting everything possible in the config file. Will the directories also belong to you? If so, there's no reason to change from "All". Restrictions only become necessary when some directories are used by other people and you don't want them doing things that will slow down the whole server or potentially create a big mess.
Msg#: 4403151 posted 9:06 am on Jan 4, 2012 (gmt 0)
I did eventually go to the official documentation. My post demonstrates how little I know about this. As I understand it now, you can only do what the book suggests if you have control of the config file and the ”AllowOverride” setting can’t be made in htaccess? When the time comes I expect to be on a shared server, at least to start with, so presumably I won’t have control of the config file and the default will be set as “All”?
My attention was drawn by the comment in the book that the server has to look through every Directory on the path to a given file to see if there is an htaccess file present. I was hoping to lighten the load.
Is it possible with htaccess to do per Directory directives so that everything is in the root htaccess or is this only possible in the config file?