4

The tree structure is as below, and was built so, according to the navigation menu UI design:

sitecore
-content
--Website
---groceries
----fruits (this is just a folder and not a page)
-----apple
---electronics (this is just a folder and not a page)
----radio

The current URLs are:
www.example.com/groceries/fruits/apple
www.example.com/electronics/radio

But the recommended SEO URLs are
www.example.com/fruits/apple
www.example.com/electronics/radio

Also, when end user browses www.example.com/groceries, it should redirect to www.example.com/fruits/apple

There is no consistent pattern compared to the Menu and how the SEO URLs should be.

I would like to know the procedure/approach to achieve this kind of URL mapping.

using Sitecore 8.2 with MVC

2 Answers 2

8

The simplest way would be to separate the navigation from the content structure. So create your navigation to work from a Datasource root item that defines how your nav is built. Each item can then contain fields for the text and link.

Then build your content tree as you want your Url's to be set. So your content tree would then look something like:

sitecore
-content
--Website
// this is your datasource content
---Local Content
----Navigation
-----groceries
------fruits (this is just a folder and not a page)
-------apple
-----electronics (this is just a folder and not a page)
------radio
// these are your page items
---fruits
-----apple
---electronics (this is just a folder and not a page)
-----radio

Now your navigation hierarchy does not have to follow your page/url structure. This is a common way to build site navigation.

1
  • Thank you Richard. I did not know having navigation & content structures separately is common/good method.
    – sukesh
    Dec 15, 2016 at 5:42
0

If you don't want to change your content tree, then an alternate way is to define site configuration and set startItem accordingly. For your example, site configuration can have something like below

  <site patch:before="*[@name='website']"
        name="example" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content"
        startItem="/Website" database="web" domain="extranet"
        allowDebug="true" cacheHtml="true" htmlCacheSize="50MB" registryCacheSize="0"
        viewStateCacheSize="0" xslCacheSize="25MB" filteredItemsCacheSize="10MB" enablePreview="true"
        enableWebEdit="true" enableDebugger="true" disableClientData="false" cacheRenderingParameters="true"
        renderingParametersCacheSize="10MB" />

</sites>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.