解决方案 »

  1.   

    服务器iis添加html后缀就可以了
      

  2.   

    可以通过数据库,保存每个伪静态,在请求的时候返回。下面的例子中以类似于这种伪静态为例: http://www.ABC.com/Test/,你也可以改成http://www.ABC.com/Test.htm或http://www.ABC.com/Test.aspx,或者http://www.ABC.com/测试/,看个人喜好。注意修改重写URL前的判断条件就可以了Public Class URLRewrite
        Implements IHttpModule
        Private Shared wwwRegex As New Regex("https?://www\.", RegexOptions.IgnoreCase Or RegexOptions.Compiled)    Public Sub Dispose() Implements System.Web.IHttpModule.Dispose    End Sub
        Public Sub Init(ByVal context As System.Web.HttpApplication) Implements System.Web.IHttpModule.Init
            AddHandler context.BeginRequest, AddressOf BeginRequest
        End Sub    Private Sub BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
            Dim app As HttpApplication = CType(sender, HttpApplication)
            Dim Request As HttpRequest = app.Request
            Dim Response As HttpResponse = app.Response
            Dim sRequestedURL As String = Request.Url.ToString.ToLower
            Dim sRequestedRawURL As String = Request.RawUrl
            Dim bWWW As Boolean = wwwRegex.IsMatch(sRequestedURL)
            Dim redirectURL As String = String.Empty
            If bWWW AndAlso sRequestedURL.EndsWith(".aspx") Then
                redirectURL = wwwRegex.Replace(sRequestedURL, String.Format("{0}://", Request.Url.Scheme))
                Do301Redirect(Response, redirectURL)
            End If        If sRequestedURL.EndsWith("/") Then
                Rewrite(app)
            ElseIf Not sRequestedRawURL.Contains(".") Then
                Rewrite(app)
            End If    End Sub    Private Sub Do301Redirect(ByVal Response As HttpResponse, ByVal redirectURL As String)
            Response.RedirectLocation = redirectURL
            Response.StatusCode = 301
            Response.End()
        End Sub    Private Sub Rewrite(ByVal app As HttpApplication)
            Dim request As HttpRequest = app.Request
            Dim strHost As String = request.Url.Host
            Dim requestedURL As String = app.Context.Request.Url.ToString       Using lSiteMapRst As New SiteMapRepository(Globals.Settings.DefaultConnectionStringName)
                Dim lURLFile As String = Helpers.GetURLPath(requestedURL).ToUpper
                Dim Settings As FYDQSection = CType(WebConfigurationManager.GetSection("FYDQ"), FYDQSection)
                Dim lSiteMap As SitemapInfo = lSiteMapRst.GetItem(lURLFile.Replace(Settings.devSiteName.ToUpper & "/", ""), True)            If Not IsNothing(lSiteMap) Then
                    If lSiteMap.RealURL <> lURLFile Then
                        HttpContext.Current.RewritePath("~/" & lSiteMap.RealURL, False)
                    ElseIf lSiteMap.URL <> lSiteMap.RealURL Then
                        Do301Redirect(app.Response, Path.Combine(Globals.Settings.SiteDomainName, lSiteMap.URL))
                    End If
                Else                '注意分配的IP地址,此处以192.168.1.2为例
                    If Not requestedURL.EndsWith(".2") AndAlso Not requestedURL.EndsWith(".2/") Then
                        app.Response.Redirect(Globals.Settings.SiteDomainName & "/错误404/")
                    End If            End If        End Using
        End SubEnd Class
    发布到虚拟空间后,没权利修改啊
      

  3.   

    另外,例子中涉及到SitemapInfo,是通过数据库中Sitemap数据表生成的实体模型。并使用了一个SiteMapRepository类,定义了一些相对实体模型的操作,无非就是CRUD,这个很简单
      

  4.   

    这就是平时不用iis开发的后果。你让服务器供应商设置为集成模式就行了。
      

  5.   


    哦,不设置映射.html页面吗?
    本地的iis是托管模式的吗?什么是托管模式?什么是集成模式?
      

  6.   

    改个页面访问的后缀(把.aspx改为.html)有什么意义?
      

  7.   

    如果你一定非要整这种,那么你自己用十几行c#代码写一个web 80端口监听服务,然后代理给本地的asp.net网站(例如部署在IIS 88端口)就行了。
      

  8.   

    不设置IIS   几乎是不可能的为什么低成本的 措施 拯救不了
    非要绕那么大弯子 公司买不起 服务器?还是你们就无权更改。。无权更改 也得说明下
      

  9.   

    如果是IIS7还好些http://www.jb51.net/article/28617.htmhttp://www.cnblogs.com/yanzhen/archive/2012/01/07/iis7-wei-jing-tai.html