Copied to clipboard

Flag this post as spam?

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


  • Tom Maton 387 posts 660 karma points
    Mar 28, 2013 @ 00:16
    Tom Maton
    0

    URL re-writing remove /home from all URL's

    Hi all,

    Apologise of which is probably a very simple question but I've not used Umbraco in over a year and getting back into now.

    I have a site with the following structure

    Content
    -- Home (GB) - global settings
    ---- Homepage - domain.com/homepage --> this is sorted with a rewrite (see below)
    ------ Content Page 1 - domain.com/homepage/content-page-1
    ------ Content Page 2 - domain.com/homepage/content-page-2

    I want to be able to have the content pages set as domain.com/content-page-2 without the need of setting up a url alias for each url, this wouldn't be easy to manage after a while.

    Below is what I currently have in my rewrite rules

    <add name="home"
        virtualUrl= "^~/homepage$"
        rewriteUrlParameter="ExcludeFromClientQueryString"
        destinationUrl="~/"
        ignoreCase="true"
        redirect="Application"
        redirectMode="Permanent" />

    Thanks in advance

    Tom

  • gary 385 posts 916 karma points
    Mar 28, 2013 @ 20:36
    gary
    0

    Hi Tom

    Guess this is one of those . . .  .

    The top node of Umbraco is the domain regardless of what you call it, so it will not appear in the url.

    If you do not intend to have any content on that top node, re-direct as per this post.

    http://cultiv.nl/blog/2010/12/19/tip-of-the-week-the-ultimate-site-structure-setup/

    If you need other languages set them under right-click manage hostnames on the top node of each language, re-direct as required, if needed.

    Can hear you saying . . . . I knew that!

    Hope it helps

    G

  • Tom Maton 387 posts 660 karma points
    Apr 06, 2013 @ 16:49
    Tom Maton
    0

    Sorry for late reply,

    This is the post that I got the idea from and copied the idea but have run into this problem.

    I dare say I've missed something simple, but gone through it 3 times to ensure Idone it correct.

    Thanks,

    Tom

  • gary 385 posts 916 karma points
    Apr 06, 2013 @ 16:56
    gary
    100

    Hi Tom

    Just looked at it again and realised what you have done.

    You have set contentPage1 and contentPage2 as children of homepage, therefore you will get homepage in the url.

    Set the document types as children of content and it will disappear from the url.

    If you are using latest versions of Umbraco, look on docType structure tab for "allow at root" at the top, you need to check this control.

    Sorry if I had looked harder, may have seen it sooner.

    Content

    -Home

    --Homepage

    -ContentPage 1

    -ContentPage 2

     

    So contentPage 1 and 2 are same "level" as Homepage

    Hope it helps

    G

  • Tom Maton 387 posts 660 karma points
    Apr 06, 2013 @ 18:06
    Tom Maton
    0

    DOH!!!

    Thats spot on, thanks Gary.

Please Sign in or register to post replies

Write your reply to:

Draft