web.config伪静态配置的一些方法收集

web.config伪静态配置的一些方法收集.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
			     <rule name="rule1" stopProcessing="true">
                    <match url="^tags/(.*)" />
                    <action type="Rewrite" url="tag.php?tag={R:1}"  />
                </rule>
				<rule name="rule2" stopProcessing="true">
                    <match url="^tags.html" />
                    <action type="Rewrite" url="tags.php"  />
                </rule>
				<rule name="rule3" stopProcessing="true">
                    <match url="^index.html" />
                    <action type="Rewrite" url="index.php"  />
                </rule>
				<rule name="rule4" stopProcessing="true">
                    <match url="^.*show-.*([0-9])-([0-9]).html" />
                    <action type="Rewrite" url="show.php?contentid={R:1}&amp;page={R:2}"  />
                </rule>
            </rules>
        </rewrite>
    </system.webServer> 	
</configuration>


以上代码可以实现目录的伪静态.比如:
yg/ygzl/show-yigan-tu-1-1.html 到 show.php?contentid={R:1}&amp;page={R:2}
甚至是 yg/tgyf/show-2-1.html 到 上面的动态地址都是可以的.

你可能感兴趣的:(java,html,xml,PHP,Web)