虚拟主机ASP.NET实现Rewrite功能的方法
seo优化的时候,有的网站不可以生成静态的页面 所有就要用到伪静态啦!
今天来看下 asp.net伪静态的写法
在.net程序中实现Rewrite功能可以在webconfig中的system.webServer节点中加入以上内容就可以实现转换。
<rewrite>
<rules>
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([^/]+)/([^/]+)/([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.aspx?title={R:1}&id={R:2}&mode=
{R:3}" />
</rule>
</rules>
</rewrite>
以上代码仅供参考,请根据您程序中的实际情况进行修改。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。