Try our conversational search powered by Generative AI!

Upgrade urls not being rewrote to friendly versions

Vote:
 

Hi

I have upgraded a site to 7.5 (This is not the first site I have upgraded).

The site is not rewriting internal urls.

I have dissassembled the code (v7.9.1) and can see that a response filter stream should be added in UrlRewriteModule.HtmlAddRewriteToExternalFilter.

Unfortunately this filter is not being added.  I believe this may be becuase UrlRewriteModule.FURLRewriteResponse is returning false.

Has anybody in the world experienced similar issues or know what the cause may be?

Thanks

Lee

#112156
Oct 23, 2014 14:04
Vote:
 

I have managed to put in a temporary hacky fix for this which was to call

HtmlRewriteFilter.Initialize(0); on application start.

What I don't understand is why the HtmlRewriteFilter PlugIn is not being loaded and initialized?

#112159
Oct 23, 2014 14:21
Vote:
 

After lots of decompilation and reflector pro debugging I have found out the cause to my problem.

Our custom Base class for pages was not inheriting TemplatePage because it was trying to modify the controls collection in the page.

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

So we inherited PageBase and were forced to add a constructor with enable, disable int flags :

PageBase() : base (0, 0)
{}

I now see that TemplatePage passes in a HtmlRewriteFilter flag, so this was the reason why it was not being enabled on my pages.

public TemplatePage(int enable, int disable) : base(HtmlRewriteFilter.OptionFlag | QuickNavigator.OptionFlag | enable, disable)
{
}

public PageBase(int enable, int disable) : this((PageTranslation.OptionFlag | LoadCurrentPage.OptionFlag | ServerTransferBugfix.OptionFlag | PageVisited.OptionFlag | enable) & ~disable)
{
}

#112212
Oct 24, 2014 14:41
* 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.