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

Adobe AEM Linkrewriter

dilips52296497
Level 2
Level 2

 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

 

 

1 Accepted Solution
Jörg_Hoh
Correct answer by
Employee
Employee

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.JcrResourceRes...), 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

View solution in original post

2 Replies
Jörg_Hoh
Correct answer by
Employee
Employee

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.JcrResourceRes...), 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