November Happy Hour will be moved to Thursday December 5th.

How do I get the friendly URL from within a HTTP module?

Vote:
 

How do I get the friendly URL for the actual page, or basically the address shown in the browser's address bar, from within a HTTP module?

What I've come up with so far is like this:

using EPiServer; using EPiServer.Web; using System.Text;  HttpApplication application = (HttpApplication)sender; HttpContext context = application.Context; UrlBuilder urlBuilder = new UrlBuilder(context.Request.Url.PathAndQuery); FriendlyUrlRewriteProvider provider = new FriendlyUrlRewriteProvider(); provider.ConvertToExternal(urlBuilder, null, Encoding.Default);  string url = urlBuilder.Path + urlBuilder.Query;


But it doesn't work for pages that are set to get their data from another page (under Shortcut/External link). Then I get the URL of the page selected undet that tab, not the address shown in the browser's address bar.

My module is triggered by the Application.BeginRequest event, and it makes no difference to change it to Application.EndRequest.

Is there anyway to achieve this?

Best Regards
Kristoffer Av Ekenstam

#33005
Sep 28, 2009 16:56
Vote:
 

Within a user control I have used:

Request.RawUrl

and this gives the URL that the user entered.

#33035
Sep 30, 2009 11:34
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.