More in this section

Forums / Developing with Sitefinity / Conflict between CmsHttpModule and ColdFusion Handler

Conflict between CmsHttpModule and ColdFusion Handler

4 posts, 0 answered
  1. Scott McNeany
    Scott McNeany avatar
    44 posts
    Registered:
    09 Mar 2010
    19 May 2010
    Link to this post
    I am having a problem using the 'QueryString' and 'PathPrefix' persistence modes when combined with non-Sitefinity pages. In particular, I am requesting a ColdFusion file at http://somesite.com/applications/go/, but the CmsHttpModule appears to be running first and attempting to append the querystring 'sflang=en' or the path prefix of '/en/' and this causes a redirect loop for some reason, and it appears that is because the CmsHttpModule runs before the ColdFusion Wildcard Handler (modules before handlers).

    Note that this does not happen when actually requesting the site as http://somesite.com/applications/go/index.cfm either because the CmsHttpModule does not run or the ColdFusion Wildcard Handler does not run. I'm not sure.

    Here is a small chunk of the HTTP response showing the redirect loop.

    http://qa.imglobal.com/applications/go?sflang=en

     

    GET /applications/go?sflang=en HTTP/1.1

    Host: qa.imglobal.com

    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)

    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

    Accept-Language: en-us,en;q=0.5

    Accept-Encoding: gzip,deflate

    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

    Keep-Alive: 115

    Connection: keep-alive

     

    HTTP/1.1 301 Moved Permanently

    Content-Type: text/html; charset=UTF-8

    Location: http://qa.imglobal.com/applications/go/?sflang=en

    X-Powered-By: ASP.NET

    p3p: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"

    Date: Wed, 19 May 2010 13:33:40 GMT

    Content-Length: 172

    ----------------------------------------------------------

    http://qa.imglobal.com/applications/go/?sflang=en

     

    GET /applications/go/?sflang=en HTTP/1.1

    Host: qa.imglobal.com

    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)

    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

    Accept-Language: en-us,en;q=0.5

    Accept-Encoding: gzip,deflate

    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

    Keep-Alive: 115

    Connection: keep-alive

     

    HTTP/1.1 301 Moved Permanently

    Content-Type: text/html; charset=UTF-8

    Location: http://qa.imglobal.com/applications/go/?sflang=en

    X-Powered-By: ASP.NET

    p3p: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"

    Date: Wed, 19 May 2010 13:33:40 GMT

    Content-Length: 172
    ----------------------------------------------------------



    Above is my real issue, Below is just a note/suggestion for future releases:

    I would be willing to change the persistence mode to 'BrowserSettings', but that seem to work very well when modifying Generic Content. If I change my browser setting to 'Spanish', it clears out all of my Generic Content items that were created in English, rather than showing everything to me and allowing me to choose the language prior to editing an individual item. It seems to me that the persistence mode should have no control over the Admin Menu, and that even a value of 'None' should allow for the creation of multiple language versions. That's just my suggestion to you for future versions of Sitefinity though.


    Thank you,

    Scott McNeany
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 May 2010
    Link to this post
    Hi Scott McNeany,

    Thank you for your question.
    Indeed, the modules get executed before the handlers. Every request goes through each module. Our CmsHttpModule is changing the url depending on localization settings, and it does it for CMS pages only. Could you please check if there is redirect loop if you disable ColdFusion? Could you also elaborate on the pages structures, e.g. if the requested page is in page group?

    Unfortunately the CmsHttpModule could not be disabled, therefore we need another solution.

    Thank you in advance. 

    Greetings,
    Georgi
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Scott McNeany
    Scott McNeany avatar
    44 posts
    Registered:
    09 Mar 2010
    21 May 2010
    Link to this post
    Thanks for your help, Georgi. I believe the CmsHttpModule is getting executed for pages that are not in CMS. My ColdFusion page is outside the CMS, just sitting on the file server at /applications/go/index.cfm.

    If I reference it with the 'index.cfm', it works fine, but when i leave off the 'index.cfm' it hits the CF wildcard handler and loops. When I disable localization, it works.

    I don't know what you mean by the 'Page Group'. If what I said above does not answer it, please let me know.

    One other option I considered was to overwrite the default behavior of the CmsHttpModule.SetCurrentCulture(HttpContext context, CmsHttpRequest request) to make it so I could set the PersistenseMode to 'QueryString', but not rewrite the URL. This would essentially give me the same behavior with my Admin controls (I think), but allow me to manage the Culture simply by inspecting the Thread.CurrentThread.CurrentUICulture.

    However, I cannot do this because this method is marked as 'internal', and cannot be overridden. Do you have any other suggestions on how I could customize this behavior? I really do not want to rewrite the URL, but I still want all of the features of localization.

    Thank you,

    Scott 
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    24 May 2010
    Link to this post
    Hello Scott McNeany,

    I am afraid that you will not be able to to override this method as it is declared as internal. When you create links to your CF pages you could try using ResolveUrl utility to give you the current path according to the selected culture:
    <a href="<%=Telerik.Cms.Web.UrlHelper.ResolveUrl("page.aspx") %>">page</a>


    Sincerely yours,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
4 posts, 0 answered