Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

dbdigital04
Level 2
Level 2

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

 

1 Accepted Solution
edubey
Correct answer by
Level 10
Level 10

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.

View solution in original post

0 Replies
edubey
Correct answer by
Level 10
Level 10

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.

View solution in original post

dbdigital04
Level 2
Level 2

Hi edubey,

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

Regards,

Deepak