1.RewriteRule ^ (com\/.*) $ index.php?do=$1
Q: What is the match for the rule match expression "^ (. *) $" above?
A: Match content is URI
Site Directory:/d/www
url:http://127.0.0.1/admin/index.php
Corresponding local file:/d/www/admin/index.php, If it is a Windows file system, because it is not case-sensitive, if the directory under the site is the admin, then the file address here will become:/d/www/admin/ index.php, the following URI will change as Well.
Uri:admin/index.php, where the URI is removed from the file system, the part of the site directory differs from "%{request_uri}". If the directory under the site is admin,uri=admin/index.php
%{request_uri}:/admin/index.php, the part where Rul removed the domain name.
%{request_filename}:urlcorresponding to local files, here are a few points to note:
1.windows file system, The conversion is automatically based on the local folder case
2.FILENAME will automatically remove the extra parts, such as /d/www/admin/setting/index.php, If admin is an empty folder, there is nothing in it, Here's %{request_filename} =/d/www/admin/setting, it is estimated that Apache filesystem is traversed from the top-level directory, and when a directory does not exist, it is interrupted from this nonexistent directory Address.
2. Infinite loop causes error
There are multiple rewriterule in the rewrite rule, and a match to the rewriterule tag adds [L], which means that after the parsing of the rule is stopped, the subsequent rule will still run,
A: In the rewrite process, any one of the rewriterule is executed, and the entire process is repeated with the new URI until the entire process has not been rewritten to end the rewrite Program.
Apache Rewrite_mod Classic Questions and Answers