How to Set pseudo-static rules through web. config in IIS 7.5

Source: Internet
Author: User

How to Set pseudo-static rules through web. config in IIS 7.5

In is7.5, common programs use web. config to create a pseudo-static file named after web. config.

<? Xml version = "1.0" encoding = "UTF-8"?>
<Configuration>
<System. webServer>
<! -- Add the following rules here -->
</System. webServer>
</Configuration>

Remember to enable the pseudo-static feature in the background.


The following is an example of a shopex rule. Select the expected rule to add:

<! -- Shopex -->
<Rewrite>
<Rules>
<Rule name = "disableDownloadThemeHtml">
<Match url = "^ themes/. *. (html | xml) $" ignoreCase = "false"/>
<Action type = "CustomResponse" url = "/" statusCode = "403" statusReason = "Forbidden" statusDescription = "Forbidden"/>
</Rule>
<Rule name = "urlRewrite">
<Match url = "^ (. *) $" ignoreCase = "false"/>
<Conditions logicalGrouping = "MatchAll">
<Add input = "{REQUEST_FILENAME}" pattern = ". (html | xml | json | htm | php | php2 | php3 | php4 | php5 | phtml | pwml | inc | asp | aspx | ascx | jsp | cfm | cfc | pl | cgi | shtml | shtm | phtm) $ "ignoreCase =" false "/>
<Add input = "{REQUEST_FILENAME}" matchType = "IsFile" negate = "true" pattern = "" ignoreCase = "false"/>
<Add input = "{REQUEST_FILENAME}" matchType = "IsDirectory" negate = "true" pattern = "" ignoreCase = "false"/>
</Conditions>
<Action type = "Rewrite" url = "index. php? {R: 1} "appendQueryString =" false "/>
</Rule>
</Rules>
</Rewrite>
<! -- Dz2.0 -->
<Rewrite>
<Rules>
<Rule name = "portal_topic">
<Match url = "^ (. */) * topic-(.20.20..html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/portal. php \? Mod = topic & amp; topic = {R: 2} & amp; {R: 3} "/>
</Rule>
<Rule name = "portal_article">
<Match url = "^ (. */) * article-(%0-9%%*-(%0-9%%%%%%%.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/portal. php \? Mod = view & amp; aid = {R: 2} & amp; page = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "forum_forumdisplay">
<Match url = "^ (. */) * forum-(\ w1_0000-(0-91_00000000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/forum. php \? Mod = forumdisplay & amp; fid = {R: 2} & amp; page = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "forum_viewthread">
<Match url = "^ (. */) * thread-(0-9000000000000-(0-9000000000000-(0-90000000000000000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/forum. php \? Mod = viewthread & amp; tid = {R: 2} & amp; extra = page = {R: 4} & amp; page = {R: 3} & amp; {R: 5} "/>
</Rule>
<Rule name = "group_group">
<Match url = "^ (. */) * group-(0-9000000000000-(0-9000000000000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/forum. php \? Mod = group & amp; fid = {R: 2} & amp; page = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "home_space">
<Match url = "^ (. */) * space-(username | uid0000-(.20.0000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/home. php \? Mod = space & amp; {R: 2 }={ R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "home_blog">
<Match url = "^ (. */) * blog-(0-9000000000000-(0-90000000000000000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/home. php \? Mod = space & amp; uid = {R: 2} & amp; do = blog & amp; id = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "forum_archiver">
<Match url = "^ (. */) * (fid | tid0000-(%0-9%%%%%.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/index. php \? Action = {R: 2} & amp; value = {R: 3} & amp; {R: 4} "/>
</Rule>
</Rules>
</Rewrite>
<! -- Dz2.5 -->
<Rewrite>
<Rules>
<Rule name = "portal_topic">
<Match url = "^ (. */) * topic-(.20.20..html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/portal. php \? Mod = topic & amp; topic = {R: 2} & amp; {R: 3} "/>
</Rule>
<Rule name = "portal_article">
<Match url = "^ (. */) * article-(%0-9%%*-(%0-9%%%%%%%.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/portal. php \? Mod = view & amp; aid = {R: 2} & amp; page = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "forum_forumdisplay">
<Match url = "^ (. */) * forum-(\ w1_0000-(0-91_00000000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/forum. php \? Mod = forumdisplay & amp; fid = {R: 2} & amp; page = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "forum_viewthread">
<Match url = "^ (. */) * thread-(0-9000000000000-(0-9000000000000-(0-90000000000000000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/forum. php \? Mod = viewthread & amp; tid = {R: 2} & amp; extra = page = {R: 4} & amp; page = {R: 3} & amp; {R: 5} "/>
</Rule>
<Rule name = "group_group">
<Match url = "^ (. */) * group-(0-9000000000000-(0-9000000000000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/forum. php \? Mod = group & amp; fid = {R: 2} & amp; page = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "home_space">
<Match url = "^ (. */) * space-(username | uid0000-(.20.0000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/home. php \? Mod = space & amp; {R: 2 }={ R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "home_blog">
<Match url = "^ (. */) * blog-(0-9000000000000-(0-90000000000000000.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/home. php \? Mod = space & amp; uid = {R: 2} & amp; do = blog & amp; id = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "forum_archiver">
<Match url = "^ (. */) * (fid | tid0000-(%0-9%%%%%.html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/index. php \? Action = {R: 2} & amp; value = {R: 3} & amp; {R: 4} "/>
</Rule>
<Rule name = "plugin">
<Match url = "^ (. */) * ([a-z] + [a-z0-9 _] *)-([a-z0-9 _ \ -20.20.20..html \? * (. *) $ "/>
<Action type = "Rewrite" url = "{R: 1}/plugin. php \? Id = {R: 2 }:{ R: 3} & amp; {R: 4} "/>
</Rule>
</Rules>
</Rewrite>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.