Copied to clipboard

Flag this post as spam?

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


  • Edi 5 posts 25 karma points
    Aug 05, 2010 @ 10:51
    Edi
    0

    Different landing page

    Hi there,

    i have got the following problem and I wondered whether someone could provide me a good hint on how to move on:

    At the moment when the visitor enters my domain, say for example www.domain.com he gets forwarded to the www.domain.com/home.aspx page.

    Is there a way of diverting the visiter, so that when he enters on www.domain.com he lands on a different page, like for example www.domain.com/news-events/news.aspx ?

    I tried using the Umbraco Redirect which does the job. But then I could not get to the home.aspx any more, which contains content as well. In addition, using the Umbraco Redirect leaded to interferences with the Search functionality.

    Does someone know how to change the landing page without blocking the home.aspx?

    Thank you very much in advance for your help.

  • Sascha Wolter 615 posts 1101 karma points
    Aug 05, 2010 @ 12:11
    Sascha Wolter
    0

    Hi Edi,

    you can add a custom Url rewrite rule in /config/UrlRewriting.config like so:

            <add name="homepagerewrite"
            virtualUrl="^~/$"
            rewriteUrlParameter="ExcludeFromClientQueryString"
            destinationUrl="~/news-events/news.aspx"
            ignoreCase="true" />

    This will redirect the root url (and just this one because of the '$' at the end) to /news-events/news.aspx.

    If you want to make the destination editable in the CMS you could create a field on your web site's root node as a content picker, then write a .Net control that checks if the user has requested the domain root (www.domain.com) and redirect to the destination url.

    Hope that helps,
    Sascha

  • Edi 5 posts 25 karma points
    Aug 05, 2010 @ 12:26
    Edi
    0

    Hi Sascha,

    thanks for you reply.

    I have added the custom Url rewrite rule as described, but somehow it has no effect.

    Do you know why?

  • Sascha Wolter 615 posts 1101 karma points
    Aug 05, 2010 @ 12:56
    Sascha Wolter
    0

    Hm, have you tried restarting the web site? Maybe try out the following just for fun to see if any rewrite rule works:

     <add name="homepagerewrite"  
    virtualUrl="^~/home.aspx"
           
    rewriteUrlParameter="ExcludeFromClientQueryString"
           
    destinationUrl="~/news-events/news.aspx"
           
    ignoreCase="true" />

    This should redirect the user to /news-events/news.aspx when he visits /home.aspx.

    I have tested the first rewrite rule on my local 4.5.1 installation before posting it, so I'm pretty confident about that. You might want to try out and remove the / altogether from the first rule and see how that goes, not sure if that is needed or even matters.

    Please let me know how it goes,
    Sascha

  • Edi 5 posts 25 karma points
    Aug 05, 2010 @ 13:42
    Edi
    0

    OK, trying your 2nd example worked. I managed to get transfered to my news page when clicking home.

    I then changed it back to your original code and it did not work again.

    Then I tried virtualUrl="^~/" and virtualUrl="". In both cases I got transfered to my custom 404 Error page on all pages in my website.

    I am using umbraco v 4.0.4.2.

  • Sascha Wolter 615 posts 1101 karma points
    Aug 05, 2010 @ 14:07
    Sascha Wolter
    0

    Okay, tried it out on my current 4.0.4.2 build and it worked fine for me. Very odd. The only difference I can see at the moment is that I use directories as Urls, which means your 'news.aspx' is just 'news' with me. It might be that the url rewriting does only get called when you specifically request something with .Net (e.g. aspx) which doesn't happen at root level. What version of IIS are you working with? If it's IIS6 it might be worth adding wildcard mapping to your web site and see if that makes a difference. If you are using IIS7+ are you using classic mode or integrated pipeline?

  • Edi 5 posts 25 karma points
    Aug 06, 2010 @ 09:16
    Edi
    0

    Good morning Sascha,

    I have IIS6 installed on the webserver. I now added the wildcard mapping and everything works fine now.

    Thank you very much for your time an help, I really apreciate it.

    Regards,
    edi

  • Sascha Wolter 615 posts 1101 karma points
    Aug 06, 2010 @ 11:04
    Sascha Wolter
    0

    Hi Edi,

    great to hear that it worked out. :)

    All the best,
    Sascha

Please Sign in or register to post replies

Write your reply to:

Draft