Adobe AEM Linkrewriter | Community
Skip to main content
dilips52296497
Level 2
Apr 1, 2020 10:06 PM UTC
Solved

Adobe AEM Linkrewriter

 AEM Gurus,

 

I have a requirement in my project where i need to change the htm anchor tag href attribute value

for example,

href value = "content/abc/en/local/xyz.html"

 

I want to replace it by removing content from it 

href value = "/abc/en/local/xyz.html'

 

I am able to achieve it using the Linkrewriter start element

 

However what we are looking for is get the complete HTML into string and do a find all and replace....

is it possible? if Yes please give full details.

 

Regards

Dilip

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Employee
Apr 3, 2020 5:22 PM UTC

Doing a string replace in all the content is probably creating issues sooner or later. In your case you can achieve the same result with the configuration of the Resource Resolver Factory (http://localhost:4502/system/console/configMgr/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl), in the paramater "URL mapping" (resource.resolver.mapping). There you can configure AEM to resolve /abc/en/page.html to the path /content/abc/en/page.html

2 replies

Suraj_Kamdi
New Participant
Apr 6, 2020 8:28 AM UTC
joerghoh
joerghohAccepted solution
Employee
Apr 3, 2020 5:22 PM UTC

Doing a string replace in all the content is probably creating issues sooner or later. In your case you can achieve the same result with the configuration of the Resource Resolver Factory (http://localhost:4502/system/console/configMgr/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl), in the paramater "URL mapping" (resource.resolver.mapping). There you can configure AEM to resolve /abc/en/page.html to the path /content/abc/en/page.html

Translate