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

Magnus Rahl
Mar 2, 2010
  4609
(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
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog