Forum Moderators: phranque
AccessFileName .htaccessA .htaccessB
My .htaccess file has a lot of stuff that I don't want to change, and other parts that are more fluid.Parts you don't plan to change don't belong in htaccess; they belong in config. Problem solved ;)
AccessFileName .htaccessA .htaccessBNot according to the docs: AccessFileName works the same way as, for example, DirectoryIndex, where it grabs the first available option and stops looking.
I'm not sure what you mean by grabbing the first option and then stopping looking
AccessFileName .htaccess1 .htaccess2 So you maintain two separate files, like I'm wanting to do, but just concatenate them into a third and post just that one?
That sort of implies that this statement is going to do something with that second filename, no?What the docs [httpd.apache.org] actually say (no significant change between 2.2 and 2.4) is
Emphasis mine, punctuation theirs.While processing a request, the server looks for the first existing configuration file from this list of names in every directory of the path to the documentAccessFileName filename [filename] ...
AccessFileName filename [filename] ...which appears to mean that you can put as many filenames as you want in the statement but I'm only going to pay any attention to the first one and not hand you an error message. That strikes me as pretty odd syntax. I mean if you're not going to pay any attention to the second filename, why even offer it in the syntax description? OK, it looks like I'm going to be doing cat .htaccess1 .htaccess2 > .htaccess
if you're not going to pay any attention to the second filename, why even offer it in the syntax description?
DirectoryIndex index.html index.php index.htm index.jsp
means: "If there's a file called index.html, use it. If not, look for index.php. If there is one, use it. If not" et cetera. I don't know what real-life situations would call for something similar w/r/t htaccess-or-equivalent files. Maybe in shared hosting you'd use a different name in some situations? inherit allows htaccess specified in the parent directory to apply to a child directoryFor almost everything except mod_rewrite, inheritance is the default: use the top-level directives PLUS the next-level directives PLUS the ones after that, all the way down the line. But even with "RewriteOptions inherit", mod_rewrite doesn't work that way. Here, "inherit" means: "If no RewriteRules in the present htaccess apply to the request, then go back and apply anything from the previous level". So, unlike other mods, you can't have multiple RewriteRules applied to the same request. (It actually says so in the docs, but I didn't believe them, so I experimented.)
cat .htaccess1 .htaccess2 > .htaccess