More in this section

Forums / Developing with Sitefinity / CmsHttpModule.GetUrl() returns empty string

CmsHttpModule.GetUrl() returns empty string

2 posts, 0 answered
  1. Gary
    Gary avatar
    91 posts
    Registered:
    19 Jul 2007
    25 Feb 2009
    Link to this post
    I've implemented your approach described in the following post to support multiple websites from one Sitefinity version 3.6 installation:

    http://www.sitefinity.com/support/forums/support-forum-thread/b1043S-bbbahh.aspx

    In this sample, base.GetUrl(context) is called from DomainUrlRewriteModule, which inherits from CmsHttpModule. However, I have found that the call to CmsHttpModule.GetUrl(context) returns an empty string rather than the value of context.Request.RawUrl, which is the correct value per the documentation.

    Can you shed any light on this?

    Thanks,
    Gary

  2. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    25 Feb 2009
    Link to this post
    Hi Gary,

    Thank you for pointing this out.

    This change was caused by fixing some problems with using the Advanced URL Rewriter.
    You are right, the solution provided in that thread should be updated, i.e.:

        public class DomainUrlRewriteModule : CmsHttpModule    
        {    
            protected override string GetUrl(HttpContext context)    
            {    
                string path = base.GetUrl(context);  
                if (String.IsNullOrEmpty(path))  
                    path = context.Request.RawUrl;    
                path = DomainUrlHelper.UnresolveUrl(path);    
                return path;    
            }    
        }    
     


    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered