Regular expression should be an old friend of developer. We should look deep into this technology
Pattern
URL Rewrite
IIS Server Variables
http://domain.com:port/directory/filename[.extension]?parameterA=1¶meterB=2
{REQUEST_FILENAME}
/directory/filename[.extension]
Used to determin whether the url are trying to requrest the real path or file. Generatlly speaking, the variable can filter the requrest for real file without redirect/rewrite.
{HTTP_HOST}
domain.com
{SERVER_PORT}
port
{REQUEST_URI}
/dir/filename?parameterA=1¶meterB=2
{QUERY_STRING}
parameterA=1¶meterB=2
Once a Rule or Condition matched a pattern, the system will return its value and save them into predefined variables
{R:N}, save the result for URL pattern
{C:N}, store the result for Condition pattern
We can use those new variables to define our redirect/rewrite action