This is a dumb question, but is there a syntax specification for the Apache .htaccess file format?
All I can find are "tutorials", that is not what I want.
What I want is a list of all the valid keywords that will be recognized in a .htaccess file and what all the valid parameters and functions are. Does this exist?
.htaccess is a way to put a
<Directory>
specification inside a file which is in this directory.So every Apache documentation settings that is tagged as available at a
Directory Levels
is available on a .htaccess. Fore example take a look at ErrorDocument documentation you have in the main box a Context settings, here we can see this context contains 'Directory', so it's available on a .htaccess. That means as well that if you have access to apache configuration it's better in term of performances to use a<Directory /my/dir>
section than a.htaccess
in/my/dir
. As you could forbid .htaccess and avoid file system reads. When you use .htaccess files Apache is looking for a .htaccess in your directory and all parent directories.Now, I just said you can forbid .htaccess files, you do that with:
Which means .htaccess files cannot override any configuration setting (and Apache will stop looking for these files on the filesystem). AllowOverride can take other values, and that mean some of the available settings won't be available in your .htaccess if the apache admin do not want you to break everything.
Edit:
for a quick reference, which is the main point, you have this table in apache documentation, where all directives are listed, check the 'd' for directory, and you have your .htaccess reference.
an .htaccess file takes pretty much a good chunk of whatever your main apache config can take. I doubt there is going to be a page that lists everything that can go in one. Pretty much any module you can load into apache, you can use that module's config in a .htaccess file.
http://httpd.apache.org/docs/2.0/howto/htaccess.html
http://httpd.apache.org/docs/2.0/configuring.html#syntax