+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / <urlMappings> problems

&lt;urlMappings&gt; problems

3 posts, 0 answered
  1. Isaac
    Isaac avatar
    63 posts
    Registered:
    01 Dec 2008
    08 Aug 2011
    Link to this post
    My current sitemap:
    AllPages
    ...index (marked as homepage)
    ...page1
    ...page2
    ...second-site-root
    ......page1
    ......page2

    I have set up 2 urls:
    mainsite.ext.net
    secondsite.ext.net

    in my web.config
    <urlMappings>
       <add key="secondsite.ext.net" value="second-site-root" shared="false" />
    </urlMappings>

    I'm attempting to utilize the sitemap to custom build navigation based on whatever is returned from this call:
    CmsSiteMapNode siteRoot = (CmsSiteMap.Provider.RootNode as CmsSiteMapNode);

    Where any page from the 'regular' mainsite.ext.net will return the SitemapRoot, and any page from the secondsite.ext.net will return the 'second-site-root' as its root node.

    When I hit http://secondsite.ext.net/ I get served the expected page from the sitemap. however when I hit http://secondsite.ext.net/index.aspx I get served the home page from the 'regular' site.

    http://secondsite.ext.net/page1.aspx <-- works
    http://secondsite.ext.net/page2.aspx <-- works

    I thought for sure it was just a problem with the defaultdocument settings in IIS7.5 but I believe I cleared them all out with this entry:
    <system.webServer>
       ...
       <defaultDocument enabled="true">
          <files>
             <clear />
          </files>
       </defaultDocument>
    </system.webServer>
    Even with this, the behavior continues.
    Did I set up the <urlMappings> incorrectly?
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    02 Dec 2016
    11 Aug 2011
    Link to this post
    Hi Isaac,

    Please take a look at this KB article, I believe you might find it useful. If you have some additional questions, please do not hesitate to let us know.

    Greetings,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Isaac
    Isaac avatar
    63 posts
    Registered:
    01 Dec 2008
    11 Aug 2011
    Link to this post
    I believe the default urlMapping service will work as advertised. I believe my problem is stemming from some internal url forwarding or whatever the appropriate term for it might be.

    I followed another post on the forum to disable some of the sitefinity url rewriting in favor of the iis7 url rewriter with this:
    public class CustomCmsHttpModule : CmsHttpModule
    {
        protected override CmsRequest GetCmsRequest(HttpContext context)
        {
            return new CmsRequest(context.Server.UrlDecode(context.Request.Url.PathAndQuery));
        }
    }
    This has worked excellently except for one small problem i cant seem to track down.

    A request to http://mysite.foo.net/ or http://mysite.foo.net will get 301 redirected to my homepage in sitefinity (homepage is named mysite-root.aspx -- I named it something strange because i wanted to eliminate the possibility that defaultDocuments was somehow responsible even though my sys admin assured me they are not turned on).

    Anyway, what further methods do I need to override so that http://mysite.foo.net/ and http://mysite.foo.net will 404 like I want them to?
Register for webinar
3 posts, 0 answered