URL Rewrite Engine
The URL Rewrite Engine provides a subset of the Apache
mod_rewrite module. For more
information, refer to http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
and http://httpd.apache.org/docs/2.0/misc/rewriteguide.html.
DWebPro supports the following directives:
-
RewriteBasePath -
RewriteCondTestString CondPattern [Flags] -
RewriteRulePattern Substitution [Flags]
The RewriteCond CondPattern
field and the RewriteRule
Substitution field can include the following variables:
| HTTP_USER_AGENT | DOCUMENT_ROOT | TIME_YEAR |
| HTTP_REFERER | SERVER_ADMIN | TIME_MON |
| HTTP_HOST | SERVER_NAME | TIME_DAY |
| HTTP_ACCEPT | SERVER_ADDR | TIME_HOUR |
| REMOTE_ADDR | SERVER_PORT | TIME_MIN |
| REMOTE_HOST | SERVER_PROTOCOL | TIME_SEC |
| REQUEST_METHOD | SERVER_SOFTWARE | TIME_WDAY |
| SCRIPT_FILENAME | ||
| QUERY_STRING | ||
| REQUEST_URI |
All of these should be structured as %{NAME_OF_VARIABLE}.
The RewriteCond CondPattern
field can contain a regular expression with the following
additions:
-
If it starts with the ! character, the result will be inverted.
-
The CondPattern field will be treated as a plain string if it starts with one of the following characters: =, >, or <. In addition, it will be applied a lexical comparison against TestString (equal, major, minor).
-
If it is equal to -d, TestString will be treated as a path and checked to ensure it exists and is a folder.
-
If it is equal to -f, TestString will be treated as a path and checked to ensure it exists and is a file.
-
If it is equal to -s, TestString will be treated as a path and checked to ensure it exists and is a file with a size greater than 0 bytes.
The RewriteCond directive supports
the following flags:
-
NC
-
OR
These flags are handled in the same manner as in Apache. The
RewriteRule Pattern field
contains a regular expression that will be applied to the
DocumentPath of the current HTTP request.
The RewriteRule
Substitution field can contain a back-reference, such as $N
con 0 <= N <= 9.
The RewriteRule directive supports
the following flags:
-
L
-
NC
-
R
-
QSA
These flags are handled in the same manner as they are in Apache.
To test your rewrite rules with DWebPro you can use the provided Rewrite Engine Tester tool, which is located under the DWebPro Utilities Program Group.


