Web.config文件是一个XML文本文件,它用来储存ASP.NETWeb 应用程序的配置信息。IIS启动时会加载配置文件中的配置信息,然后缓存这些信息,在运行过程中应用程序会监视配置文件的变化情况,一旦编辑修改了这些配置信息,就会重新读取这些配置信息并缓存。
今天项目重要用到Web.Config配置伪静态,简单写一下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="destoon_rewrite_0">
<match url="^index.html$" />
<action type="Rewrite" url="/index.php" />
</rule>
<rule name="destoon_rewrite_1">
<match url="^(kctx|zysz|school|about|app)/(index.php|index.html)?$" />
<action type="Rewrite" url="/index.php?a=default/{R:1}" />
</rule>
<rule name="destoon_rewrite_3">
<match url="^(news|hd)/(list\.html|list-1\.html|index.html)?$" />
<action type="Rewrite" url="/index.php?a={R:1}/index" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>