# \_index\_ question

**URL:** <https://community.bloomreach.com/t/index-question/1441>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [September 24, 2019, 11:26am UTC](https://community.bloomreach.com/t/index-question/1441 "2019-09-24T11:26:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.sinclair](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@david.sinclair](https://community.bloomreach.com/u/david.sinclair)\
**Post date:** [September 24, 2019, 11:26am UTC](https://community.bloomreach.com/t/index-question/1441/1 "2019-09-24T11:26:39Z")

</div>

Hi,

I have modelled a category page as a folder with a special file called “index” in it. The index file contains things like an title, introduction and metadata. Any other documents in the folder are rendered as the child pages of the category.

I have then added a sitemap entry using the _index_ matcher:

/_any_:  
jcr:primaryType: hst:sitemapitem  
jcr:uuid: 82feae79-11ca-4fd3-a002-31849e965fb3  
hst:componentconfigurationid: hst:pages/article  
hst:relativecontentpath: {1} /\_index\_: jcr:primaryType: hst:sitemapitem jcr:uuid: 6dc074cb-7038-4d57-bda8-908ac5af946b hst:componentconfigurationid: hst:pages/category hst:relativecontentpath: {parent}/index

This seems to work well but I have noticed that links to the category (i.e. the index file in a folder) come out as “/mycategory/index” rather than to “/mycategory/”. The page is served at both /mycategory/ and at “/mycategory/index”

How can I ensure that links are generated as “/mycategory/”? (Or is my approach to modelling categories wrong?)

Thanks,

David

---

<div class="post-metadata">

**Author:** ![machak](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/machak/32/1298_2.png) [@machak](https://community.bloomreach.com/u/machak)\
**Post date:** [September 24, 2019, 12:15pm UTC](https://community.bloomreach.com/t/index-question/1441/2 "2019-09-24T12:15:09Z")

</div>

Which version are you using? This might be related to:

[https://issues.onehippo.com/browse/HSTTWO-4575](https://issues.onehippo.com/browse/HSTTWO-4575)

---

<div class="post-metadata">

**Author:** ![david.sinclair](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@david.sinclair](https://community.bloomreach.com/u/david.sinclair)\
**Post date:** [September 24, 2019, 12:21pm UTC](https://community.bloomreach.com/t/index-question/1441/3 "2019-09-24T12:21:05Z")

</div>

We are using 13.3.0 so we should already have that bugfix?

---

<div class="post-metadata">

**Author:** ![Leon\_Jongsma](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@Leon\_Jongsma](https://community.bloomreach.com/u/Leon_Jongsma)\
**Post date:** [September 24, 2019, 6:42pm UTC](https://community.bloomreach.com/t/index-question/1441/4 "2019-09-24T18:42:58Z")

</div>

Hi,

I think you should model your sitemap different, as documented on this page:  
[https://documentation.bloomreach.com/library/concepts/hst-configuration-model/use-](https://documentation.bloomreach.com/library/concepts/hst-configuration-model/use-)_index_-sitemap-items.html

If you use a _index_ sitemap and set the relative content path to the index file. Then /mycategory/ links to the correct index file and the links will be correctly generated.

---

<div class="post-metadata">

**Author:** ![david.sinclair](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@david.sinclair](https://community.bloomreach.com/u/david.sinclair)\
**Post date:** [September 25, 2019, 10:03am UTC](https://community.bloomreach.com/t/index-question/1441/5 "2019-09-25T10:03:30Z")

</div>

Hi Leon,

I have done some more investigation and the issue seems to be that If I add _index_ under a _default_ sitemap entry everything behaves as I want.

The issue is that I want arbitrary depth categories and so I have used an _any_ sitemap entry with a child _index_. When i do this urls are generated with the /index. On reading the docs it does mention that _index_ cannot be a child of _any_.

I am not sure if there is a way to support arbitrary depth categories? In reality there is a limit to the depth we would create but it would nice to have a compact sitemap.

David

---

<div class="post-metadata">

**Author:** ![jasper.floor](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jasper.floor/32/28_2.png) [@jasper.floor](https://community.bloomreach.com/u/jasper.floor)\
**Post date:** [September 25, 2019, 11:18am UTC](https://community.bloomreach.com/t/index-question/1441/6 "2019-09-25T11:18:23Z")

</div>

\_any\_ always consumes the rest of the path, so it can never have children. This doesn’t mean you cannot have arbitrary depth categories, just not using this mechanism. You could have an index document on a url without referencing that document. The component that serves the request merely needs to know it has to retrieve a document called index on its relative content path.

---

<div class="post-metadata">

**Author:** ![Leon\_Jongsma](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@Leon\_Jongsma](https://community.bloomreach.com/u/Leon_Jongsma)\
**Post date:** [September 25, 2019, 9:07pm UTC](https://community.bloomreach.com/t/index-question/1441/7 "2019-09-25T21:07:08Z")

</div>

Hi David,

If you combine the _default_ sitemap with the index sitemap then you only need the any sitemap. Perhaps as fallback. I would only use the any sitemap for folders where no landing pages are needed.

Hope this helps.
