Apache's allowoverride parameters
When using Apache's rewrite module to rewrite URLs, the rewrite rules are written in the. htaccess file.
However, to enable Apache to read the contents of the. htaccess file properly, you must configure the directory where the. htaccess is located.
From security considerations, the AllowOverride property of the root directory is generally configured to disallow any override, i.e.:
1 < />2allowoverride None3< /directory>
When AllowOverride is set to None, the. htaccess file is completely ignored. When this directive is set to all, any directives with the ". htaccess" Scope are allowed to appear in the. htaccess file.
For URL rewrite, at a minimum, you need to set the directory to:
1 < /myblogroot/>2allowoverride FileInfo3< /directory>
For URL rewrite, at a minimum, you need to set the directory to:
allow only in <Directory> configuration segments
allowoverride is only valid in <Directory> configuration segments that do not contain regular expressions. In <location>, <directorymatch>, <Files> is not valid in the configuration section.
If this directive is set to none, then the. htaccess file will be completely ignored. In fact, the server does not read the. htaccess file at all.
Parameters of the allowoverride:
Authconfig
Allows the use of instructions related to certification authorizations (Authdbmgroupfile, Authdbmuserfile, AuthGroupFile, AuthName, AuthType, AuthUserFile, Require, etc.).
FileInfo
Directives that allow the use of control document types (DefaultType, ErrorDocument, Forcetype, languagepriority, SetHandler, Setinputfilter, Setoutputfilter, Add* and remove* directives in mod_mime, etc.), instructions for controlling document metadata (Header, Requestheader, Setenvif, Setenvifnocase, Browsermatch, Cookieexpires , Cookiedomain, Cookiestyle, cookietracking, cookiename), mod_rewrite directives (Rewriteengine, rewriteoptions, RewriteBase, Rewritecond, Rewriterule), and the action directive in mod_actions.
Indexes
Allows the use of commands that control the index of the directory (Adddescription, AddIcon, addiconbyencoding, Addiconbytype, DefaultIcon, DirectoryIndex, FancyIndexing, Headername, Indexignore, indexoptions, Readmename, etc.).
Limit
Allows the use of commands that control host access (Allow, Deny, Order).
Options[=option,...]
Allows the use of commands (options and Xbithack) that control the functionality of the specified directory. You can append a comma-delimited list of options (no spaces) after the equals sign to control which options are allowed for the option directive.
Apache's allowoverride parameters