02
2019
08

web.config伪静态实现二级域名绑定二级目录并去除.asp后缀

                   <match url="^(.*)$" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="^(.+)\.t\.tt$" />
                    </conditions>
                    <action type="Rewrite" url="{HTTP_HOST}/{R:1}" />
                </rule>        
                <rule name="test.tt3">
                    <match url="^(\w+).t.tt/(.*)$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/{R:1}/{R:2}" />
                </rule>  
                <rule name="delasp" stopProcessing="true">
                    <match url="hik/(.+)\.asp(.*)" />
                    <conditions>
                        <add input="{HTTP_HOST}" pattern="^hik.t.tt$" />
                    </conditions>
                    <action type="Redirect" url="http://{HTTP_HOST}/{R:1}{R:2}" />
                </rule>

« 上一篇下一篇 »