How to Use Regular Expression | Minicoder

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&parameterB=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&parameterB=2

{QUERY_STRING}

parameterA=1&parameterB=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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章