Syntax: RewriteRule Pattern Substitution [flags]
- (dash)
A dash indicates that no substitution should be performed (the existing path
is passed through untouched). This is used when a flag (see below) needs to
be applied without changing the path.
last|L
Stop the rewriting process immediately and don't apply any more rules.
Especially note caveats for per-directory and .htaccess context.
第3行是完全匹配index.php的URI,但不做替换,并且匹配成功后就停止执行重写过程。
第6行就是把所有的访问请求重写,指给index.php,然后停止执行重写过程。
123456789101112131415161718
Syntax: RewriteCond TestString CondPattern
REQUEST_FILENAME
The full local filesystem path to the file or script matching the request,
if this has already been determined by the server at the time REQUEST_FILENAME
is referenced. Otherwise, such as when used in virtual host context, the same
value as REQUEST_URI.
You can prefix the pattern string with a '!' character (exclamation mark) to
specify a non-matching pattern.
'-d' (is directory)
Treats the TestString as a pathname and tests whether or not it exists, and
is a directory.
'-f' (is regular file)
Treats the TestString as a pathname and tests whether or not it exists, and
is a regular file.