IIS 7 and IIS 7.5 and later versions estimate that the pseudo-static rules will be implemented using Web. config, so our previous pseudo-static files must be changed. Find a circle on the internet, have not found a more comprehensive web. config pseudo-static rules, so we are here to organize a copy for the first use of friends reference.
Implement a normal page, with a numeric parameter page and a pseudo-static with two parameter pages!
?
12345678910111213141516171819202122232425 |
<?
xml version
=
"1.0" encoding
=
"UTF-8"
?>
<
configuration
>
<
system.webServer
>
<
rewrite
>
<
rules
>
<
rule name
=
"Index" stopProcessing
=
"true"
>
<
match url
=
"^index.html" />
<
action type
=
"Rewrite" url
=
"index.php" />
</
rule
> <
rule name
=
"Rule1" stopProcessing
=
"true"
>
<
match url
=
"^news_([0-9]+).html" />
<
action type
=
"Rewrite" url
=
"news.php?nid={R:1}" />
</
rule
>
<
rule name
=
"Rule2" stopProcessing
=
"true"
>
<
match url
=
"news_list_([0-9]+)_([0-9]+).html" />
<
action type
=
"Rewrite" url
=
"news_list.php?nid={R:1}&page={R:2}" />
</
rule
>
</
rules
>
</
rewrite
>
</
system.webServer
>
</
configuration
>
|
IIS 7.5 uses the Web. config to implement the 301 redirection method, the domain name without www is turned to the domain name with www!
?
123456789101112131415161718 |
<?
xml version
=
"1.0" encoding
=
"UTF-8"
?>
<
configuration
>
<
system.webServer
>
<
rewrite
>
<
rules
>
<
rule name
=
"Redirect" stopProcessing
=
"true"
>
<
match url
=
".*" />
<
conditions
>
<
add input
=
"{HTTP_HOST}" pattern
=
"^chuangluo.com$" />
</
conditions
>
<
action type
=
"Redirect" url
=
"http://www.chuangluo.com/{R:0}" redirectType
=
"Permanent" />
</
rule
>
</
rules
>
</
rewrite
>
</
system.webServer
>
</
configuration
>
|
Since our website uses an escape character, you cannot directly copy the above code when you are actually using it. After copying and pasting into the editor such as Dreamweaver, use the Replace function to replace the double quotation marks with the double quotation marks in the English state, and then modify the contents of the rule label, then change to the URL of your own.
Note that the two parameters used in the previous Httpd.ini and. htaccess support URLs are & symbolic links, which are not supported in Web. config and need to be changed to & for normal use.
Original link: http://www.jb51.net/article/42901.htm
IIS7.5 using Web. config to set pseudo-static methods