Sitemap using ACS Commons - how to remove /content/ from urls | Community
Skip to main content
Level 2
January 18, 2017
Solved

Sitemap using ACS Commons - how to remove /content/ from urls

  • January 18, 2017
  • 2 replies
  • 3509 views

Hello friends, 

I am using ACS Commons Sitemap Servlet to generate sitemap xml which looks like..

<url>
<loc>
https://<Domain Name>/content/site/testing.html
</loc>
</url>
<url>

I want to get rid of /content/site/ from the url as this is how our urls are in production so that it looks like

https://<Domain Name>/testing.html

Could anyone please advise how can I achieve that? 

SitemapServlet config looks like. Anything I can put here? 

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="sling:OsgiConfig"
    exclude.property="hideInNav"
    externalizer.domain="publicSecure"
    sling.servlet.resourceTypes="sometemplate"/>

Thanks and Regards

Deepak

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by edubey

I don't think ACS commons can remove it, but you can always add an resource resolver config for your runmode like below , worked fine.

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" resource.resolver.searchpath="[/apps,/libs,/apps/foundation/components/primary,/libs/foundation/components/primary]" resource.resolver.manglenamespaces="{Boolean}true" resource.resolver.allowDirect="{Boolean}true" resource.resolver.required.providers="org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory" resource.resolver.virtual="/:/" resource.resolver.mapping="[/content/project/&lt;/]" resource.resolver.map.location="/etc/map" resource.resolver.default.vanity.redirect.status="{Long}302" resource.resolver.enable.vanitypath="{Boolean}true" resource.resolver.optimize.alias.resolution="{Boolean}true" />

 

It will remove /content/project from generated sitemap.

2 replies

edubey
edubeyAccepted solution
Level 10
January 18, 2017

I don't think ACS commons can remove it, but you can always add an resource resolver config for your runmode like below , worked fine.

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" resource.resolver.searchpath="[/apps,/libs,/apps/foundation/components/primary,/libs/foundation/components/primary]" resource.resolver.manglenamespaces="{Boolean}true" resource.resolver.allowDirect="{Boolean}true" resource.resolver.required.providers="org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory" resource.resolver.virtual="/:/" resource.resolver.mapping="[/content/project/&lt;/]" resource.resolver.map.location="/etc/map" resource.resolver.default.vanity.redirect.status="{Long}302" resource.resolver.enable.vanitypath="{Boolean}true" resource.resolver.optimize.alias.resolution="{Boolean}true" />

 

It will remove /content/project from generated sitemap.

Level 2
January 24, 2017

Hi edubey,

Sorry for replying late. Thanks a lot for posting this solution. It worked for me. 

Regards,

Deepak