More in this section
Forums / Developing with Sitefinity / CmsHttpModule.GetUrl() returns empty string

CmsHttpModule.GetUrl() returns empty string

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Gary
    Gary avatar
    91 posts
    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:

    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?


  2. Vlad
    Vlad avatar
    498 posts
    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,
    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