I have some simple code to manage redirects
If Request.Cookies("lastURL") Is Nothing Then Dim aCookie As New HttpCookie("lastURL") aCookie.Value = HttpContext.Current.Request.Url.ToString() aCookie.Expires = DateTime.Now.AddDays(1) Response.Cookies.Add(aCookie) Else Response.Cookies("lastURL").Value = HttpContext.Current.Request.Url.ToString() Response.Cookies("lastURL").Expires = DateTime.Now.AddDays(1) End If
For example if I navigate to: https://[site]page/time-to-address-the-inter-without-operability-issue
that script will cache https://[site]/Default.aspx?tabid=33&artmid=383&articleid=2495&language=en-US This sadly will break if I'm trying to direct to a DNN easy news article (not anything else) Was hoping I can figure out how to get the URL friendly name with the same bit of code My google fu is failing me and just keeps saying the same or similar things that just get me the original Thanks
Well, the second URL is what DNN always sees. Well, something like that. If you're concerned about the SEO version of your URL - the public-, human-version - then, you'll want to check the URL using a different variable.
Most likely, you'll want to no longer use this:
HttpContext.Current.Request.Url.ToString()
And instead, use this:
HttpContext.Current.Request.Url.AbsoluteUri
Or this:
HttpContext.Current.Request.Url.AbsolutePath
HttpContext.Current.Request.Url.PathAndQuery
nm work around found
Always happens right after I post to a forum
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.