views:

33

answers:

1

HEllo. I need replace double slashes in one slash. I am planning do this in Global.asax Application_BeginRequest event. Is it enough? or better do a http module? Thank you.


UPD

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)

    ' Fires at the beginning of each request 
    Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(AppSettings.UsedCulture)
    Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture


         Dim retUrl As String
         ....
         some code 
         ....

        'Dim app As HttpApplication = CType(sender, HttpApplication)
        'app.Context.RewritePath(retUrl)

         Dim myContext As HttpContext = HttpContext.Current
        'Rewrite the internal path            
         myContext.RewritePath(retUrl)

    End If

I am using .Net 1.1. And It must be on .Net 1.1 RewritePath does not rewrite URL.Why?

UPD2 Having decided to make addition redirect in Sub Application_BeginRequest with new rewritting url.

A: 

If you're using IIS 7.0 (and newer), you can use the IIS UrlRewrite module. We've been using it for a while, and have no complaints.

Esteban Araya
we are using IIS 6.0, Thank you for the link.
Sergii