Re: What's the simplest way to do URL rewriting?



>The most 'basic' part is calling either overload of:
>HttpContext.Rewrite

Do you know where I can find more information about how to use it? The
SDK is pretty short on explanation.

I tried adding the following to a page ...

void Page_Load(Object sender,EventArgs e) {
//Create a 'Httpcontext' object using 'Current' property
HttpContext myContext = HttpContext.Current;
//Rewrite the internal path
myContext.RewritePath("/");
}

and loading it, but the page (which is not the site's root page) just
loaded as normal.

How would I achieve what I asked, ie allow the user to request
http://www.whatever.com/orders/123 and have this translated into
http://www.whatever.com/orders.aspx?orderid=123

>I guess the reason why most articles appear tough is because they explain
>URL Rewriting using HTTP Modules and Handlers.

Probably. That certainly made is confusing. Please could you explain how
the HttpContext.Rewrite is used without modules and handlers.

Thanks for the reply.

--
Alan Silver
(anything added below this line is nothing to do with me)
.



Relevant Pages

  • Re: DirectX
    ... The DeviceLostException occurs because the window has lost focus. ... framework in the SDK that has handlers for all of these sorts of events. ... the SDK should also install templates into ... Visual Studio that create DirectX projects which include these handlers. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Whats the simplest way to do URL rewriting?
    ... >>URL Rewriting using HTTP Modules and Handlers. ... >the HttpContext.Rewrite is used without modules and handlers. ... You'll have to use RewritePath before the request reaches the endpoint ... That's why URL rewriting schemes use an HTTP handler - you ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Whats the simplest way to do URL rewriting?
    ... URL Rewriting using HTTP Modules and Handlers. ... That's why URL rewriting schemes use an HTTP handler - you need to catch the request in the pipeline, ...
    (microsoft.public.dotnet.framework.aspnet)