Removing /home/ from child page URLs

Tim G. asked on December 1, 2016 12:03

In my structure my child pages of the site all sit under the /Home page. However, I want to remove this from the URL of each sub page as this is effectively the site root.

So at the moment I have something like:

http://www.mysite.com/home/child-page

And ideally I'd like to configure this as this:

http://www.mysite.com/child-page

Any help on how this is done much appreciated!

Recent Answers


Adam Gitin answered on December 1, 2016 12:05

Hi Tim,

Any special reason all pages are located under Home?

0 votesVote for this answer Mark as a Correct answer

Tim G. answered on December 1, 2016 12:21

It seems a logical pattern and allows you to build a menu under the path of "/Home/%". If you move these sub pages out into the root level what's the best approach for building a menu?

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on December 1, 2016 13:05

Go to Properties -> Urls of those child pages and fill Path or pattern property with the path without Home like:

/justchild

0 votesVote for this answer Mark as a Correct answer

Adam Gitin answered on December 1, 2016 13:09

You should build your site tree in a logical way for your specific site.

lets say:

  • Home
  • About
  • News
    • Article1
    • Article2
  • About
  • Contact
    • Office1
    • Office2

Building a menu: you an configure a menu webaprt to start at root and decide how deep (levels) you want it to render. order by and add where conditions.

Can also use a repeater and transformations for full design control.

0 votesVote for this answer Mark as a Correct answer

Tim G. answered on December 1, 2016 13:14

Hi Adam - but what if there are pages from the root I don't want in my menu - say the homepage, or terms and conditions, privacy policy etc that I want to display in a footer menu. If these are all on the same level how do you exclude pages from appearing in the menu?

So my structure is something like this:

Home - Page 1 - Page 2 Terms and Conditions Privacy

but I only want the pages I consider to be children of the homepage to display in my menu?

0 votesVote for this answer Mark as a Correct answer

Adam Gitin answered on December 1, 2016 13:28 (last edited on December 1, 2016 13:28)

You can use the page Property -> Navigation

Image Text

and then in the webpart WHERE condition use these fields: DocumentMenuItemHideInNavigation

another option is to use

Image Text

and in WHERE can use something like this: MenuItemGroup IN ('top','top_footer')

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.