asp.net实现伪静态常见的有以下两种办法
1、使用我司后台有一个isapi筛选器-开启自定义URL伪静态功能,然后编辑ftp空间的others/discuz/httpd.ini文件,加上您的规则即可,规则需要自己写需编写。比如想将对xxx.htm的请求转到xxx.aspx,规则大体上是
rewriterule ^(.*)/xxx\.htm $1/xxx\.aspx
2.使用.net本身的功能实现伪静态,详情如下
2.1在我司后台点击-脚本映射-文件类型输入.html,类型选择.net,最后选择“提交”
2.2
在你的项目里引用DLL:URLRewriter.dll,然后在web.config里写
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<!-- Rules for Blog Content Displayer -->
<RewriterRule>
<LookFor>~/read(.[0-9]*)\.html</LookFor>
<SendTo>~/WebForm1.aspx?UserID=$1< ndTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<appSettings>
<add key="dbType" value ="sql"></add>
<add key="data" value="server=.;uid=sa;pwd=sa;database=pubs;Connect Timeout=30;"></add>
</appSettings>
<system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
即可。