Magnus Rahl
Mar 2, 2010
  4561
(0 votes)

Non-FURLs stop working after installing CMS 5 R2 SP2

After upgrading a site to EPiServer CMS 5 R2 SP2, incoming links on non-FURL format (i.e. http://host/template.aspx?id=xyz) stopped working. All such requests end up displaying the same garbled page, as if the start page template / IIS default document was loaded with the wrong PageData object.

A bug or a feature?

After some debate this behavior was accepted as a bug and should be fixed in the final release of CMS 6, if not before. But since CMS 6 is not released yet, and since an upgrade to CMS 6 is a bigger change than just a service pack, the bug can’t be corrected right away. I decided to post this workaround after hearing about several others having similar problems.

A workaround

I created a HTTP module, intercepting all requests. It only passes the incoming URL to the URL rewriter, which tries to rewrite the URL to a FURL. If it already is a FURL it will not be changed. This is the code for the module.

   1: namespace Sogeti.HttpModules
   2: {
   3:     public class InternalTolerantUrlRewriteModule : IHttpModule
   4:     {
   5:         public void Init(HttpApplication application)
   6:         {
   7:             application.BeginRequest += new EventHandler(this.RewriteInternalUrl);
   8:         }
   9:  
  10:         protected virtual void RewriteInternalUrl(object sender, EventArgs e)
  11:         {
  12:             HttpApplication application = sender as HttpApplication;
  13:  
  14:             if (application != null)
  15:             {
  16:                 UrlBuilder ub = new UrlBuilder(application.Request.Url.PathAndQuery);
  17:                 EPiServer.Global.UrlRewriteProvider.ConvertToExternal(ub, null, System.Text.Encoding.UTF8);
  18:                 application.Context.RewritePath(ub.ToString());
  19:             }
  20:         }
  21:  
  22:         public virtual void Dispose()
  23:         {
  24:         }
  25:     }
  26: }

Add the HTTP module to the request pipeline by adding it in the system.web/httpModules web.config section, for IIS 5 / 6:

   1: <configuration>
   2:     <system.web>
   3:         <httpModules>
   4:             <add name="InternalTolerantUrlRewriteModule" type="Sogeti.HttpModules.InternalTolerantUrlRewriteModule, Sogeti.HttpModules" />
   5:         </httpModules>
   6:     </system.web>
   7: </configuration>

For IIS 7 / 7.5 in integrated pipeline mode (NB! I haven’t tested this in IIS 7 / 7.5):

   1: <configuration>
   2:     <system.webServer>
   3:         <modules>
   4:             <add name="InternalTolerantUrlRewriteModule" type="Sogeti.HttpModules.InternalTolerantUrlRewriteModule, Sogeti.HttpModules" />
   5:         <modules>
   6:     <system.webServer>
   7: </configuration>
Mar 02, 2010

Comments

Sep 21, 2010 10:33 AM

I think this is a known problem and a hotfix is available from EPiServer if you ask them.
/ Per

Magnus Rahl
Magnus Rahl Sep 21, 2010 10:33 AM

Good to know Per. I had many contacts with EPiServer in this issue when I first ran into it but was first informed that it was closed as by design, and then that it was indeed a bug and that it would probably make the CMS 6 release. Great that there's now a hotfix so CMS 6 upgrades don't have to be rushed.

Please login to comment.
Latest blogs
Opti ID overview

Opti ID allows you to log in once and switch between Optimizely products using Okta, Entra ID, or a local account. You can also manage all your use...

K Khan | Jul 26, 2024

Getting Started with Optimizely SaaS using Next.js Starter App - Extend a component - Part 3

This is the final part of our Optimizely SaaS CMS proof-of-concept (POC) blog series. In this post, we'll dive into extending a component within th...

Raghavendra Murthy | Jul 23, 2024 | Syndicated blog

Optimizely Graph – Faceting with Geta Categories

Overview As Optimizely Graph (and Content Cloud SaaS) makes its global debut, it is known that there are going to be some bugs and quirks. One of t...

Eric Markson | Jul 22, 2024 | Syndicated blog

Integration Bynder (DAM) with Optimizely

Bynder is a comprehensive digital asset management (DAM) platform that enables businesses to efficiently manage, store, organize, and share their...

Sanjay Kumar | Jul 22, 2024

Frontend Hosting for SaaS CMS Solutions

Introduction Now that CMS SaaS Core has gone into general availability, it is a good time to start discussing where to host the head. SaaS Core is...

Minesh Shah (Netcel) | Jul 20, 2024

Optimizely London Dev Meetup 11th July 2024

On 11th July 2024 in London Niteco and Netcel along with Optimizely ran the London Developer meetup. There was an great agenda of talks that we put...

Scott Reed | Jul 19, 2024