Working principle
The. htaccess file (or distributed configuration file) provides a way to change the configuration for each directory by placing a file containing instructions in a specific directory with instructions for this directory and all of its subdirectories.
Description
If you need to use a filename other than. htaccess, you can change it with the Accessfilename directive. For example, if you need to use. config, you can configure it in the server configuration file in the following ways:
Accessfilename. config
Typically, the. htaccess file uses the same configuration syntax as the primary configuration file. The allowoverride directive determines, by category, which instructions in the. htaccess file are valid. If an instruction is allowed to be used in. htaccess, then in the description of this manual there is an overlay segment that describes the value that must be set in the allowoverride directive for this instruction to take effect.
Recently encountered some problems in the pseudo-static of. Htaccess, the following is a note of the questions encountered and the solution:
1..htaccess pseudo-Static rule formulation
# root folder access pseudo static to Cunfang1
Rewriterule ^ ([a-z0-9a-z_\-]+) (/) $/cunfang1/$1/[L]
The above rules can have all access to the folder under the root directory of the Web site, pseudo static to the corresponding folder under Cunfang1.
2. Exclude certain directories, so that the first rule can not be useful, such as the site root directory of/data,/images and so on.
# root directory folder access exclusion rule
Rewritecond $!^ (data|images|otherthings)
You can implement the specified directory exclusion functionality by placing the above code before the first rule.