Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nik Wahlberg 639 posts 1237 karma points MVP
    Aug 25, 2010 @ 13:51
    Nik Wahlberg
    0

    URL Rewrite

    This is really off-topic and I apologize for posting it in advance. But, knowing the friendly nature of all the community members, I wanted to give it a shot. 

    I have a pilot site that I'm working on that will eventually make it into Umbraco once the POC has been done, but for now, I have to "simulate" having multiple domains go to different "landing" pages. I have tried a couple of things using URL Rewrite without any particular success and honestly have not found any hits on google (specific to this case). 

    At it's simplest, I would like to have differnt domains have different "Default Documents". Is canonical domains what I am looking for? So,

    http://www.bankdomain1.com --> Deafult1.aspx
    http://www.bankdomain2.com --> Deafult2.aspx

    Thanks all for your advice.

    -- Nik

  • Sascha Wolter 615 posts 1101 karma points
    Aug 25, 2010 @ 18:05
    Sascha Wolter
    0

    Hi Nik,

    if it is just the default document you want to choose/switch based on hostname you could just create a /default.aspx page which redirects to either default1.aspx or default2.aspx depending on the hostname (get it from the Server.Request object, simple switch statement which then performs Server.Transfer). Not ideal but if you use Server.Transfer it should have as good as no impact on performance. The user will just see http://www.bankdomain1.com or the other one.

    This will obviously not work well if you need also the rest of the pages to behave in the same manner. Have you looked into setting up specific rules in IIS7?

    Hope that helps,
    Sascha

  • Richard 146 posts 168 karma points
    Aug 26, 2010 @ 12:42
    Richard
    0

    If you are using the URLRewriting.Net module you could do:

    <add name="secondSite"
    redirect="Domain"
    ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
    virtualUrl="http://www.secondsite.com/"
    redirectMode="Permanent"
    destinationUrl="http://www.firstsite.com/default2.aspx" />

    Check http://www.urlrewriting.net/.

    This method has to send the domain being forwarded to a different domain, otherwise it loops. The destination domain could be second.secondsite.com, if you can have another domain pointing at the site.

  • Ed Davison 19 posts 48 karma points
    Aug 30, 2011 @ 13:36
    Ed Davison
    0

    Hello, i've got a similar question that i'm struggling with and hope someone can help

    I'm using the url rewrite rules and have multiple domain on the same umbraco installation. 

    www.domain1.com, www.domain2.com each site contains it's own folder / 'mini-site' in umbraco etc.. 

    the redirect rules are working fine with relative paths but it's not working for full paths for some reason

       <add name="test1"
      virtualUrl="home/index.htm"
      rewriteUrlParameter="ExcludeFromClientQueryString"
      redirect ="Application"
      redirectMode ="Permanent"
      destinationUrl="/"
      ignoreCase="true" />

    above works fine

        <add name="test2"
      virtualUrl="http://www.domain1.com/home/index.htm"
      rewriteUrlParameter="ExcludeFromClientQueryString"
      redirect ="Application"
      redirectMode ="Permanent"
      destinationUrl="http://www.domain1.com/"
      ignoreCase="true" />

    above does not work

    any ideas?

    many thanks in advance

    Ed.D

  • Ed Davison 19 posts 48 karma points
    Aug 30, 2011 @ 14:08
    Ed Davison
    0

    I've discovered the issue.

    redirect ="Application"

    only works with relative URLs (duh!)

    whereas

    redirect ="Domain"

    works with the full domain path

     

     

Please Sign in or register to post replies

Write your reply to:

Draft