CQ5/AEM - Certain links are not rewriting | Community
Skip to main content
Level 2
October 16, 2015
Solved

CQ5/AEM - Certain links are not rewriting

  • October 16, 2015
  • 11 replies
  • 7492 views

We're experiencing some inconsistency with URLs on our publish instance. Some links are having the /content/project/ removed whilst others are not.

The /etc/map has been created and seems to be working as expected, except for these links.

An example of where the rewriting is links in the OOTB Text component. Just highlighted the text and used the hyperlink in the RTE. The output HTML on publish comes through as the desired

<a adhocenable="false" href="https://forums.adobe.com/path/support.html">My Link</a>

A link that's not being rewritten is from a component, in it's dialog we have a richtext xtype that is referenced in the jsp

<cq:text property="description">

This however is output on the publish as:

<a adhocenable="false" href="https://forums.adobe.com/content/project/path/support.html">Other Link</a>

I've had a look in /system/console/configMgr and the Day CQ Link Transformer Checker and this has a:href, area:href, from:action, input:value. So I thought this would pick up the links under anchors.

If anyone can suggest where I should be looking to resolve this, any help would be appreciated.

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 Sham_HC

It should work because rewriter called after html is generated. Just that your custom implementation causing not closing tags properly causing the issue.  Here are the steps to debug

1)   Access components directly <path of component>.html   ex:-  /content/geometrixx/en/jcr:content/par/text_1.html

2)    Verify it is well formed and is closing all html tags properly.

3)     If no issue in step2. Tail error.log and request for "<path of component>.html" see if there is xss warning.

4)     If no issue in step3 in component where ever you have href written add additional attribute x-cq-linkchecker= skip and update the forum with output of "<path of component>.html"

OR

1)     Disable link checker, After the change all rewrite does not happen.

2)      Access the page & go to view source of page

3)     Verify it is well formed and links in valid url in terms of syntax also.

11 replies

Sham_HC
Level 10
October 16, 2015

D-Kay wrote...

Sham HC wrote...

write own transformer for image https://helpx.adobe.com/experience-manager/using/creating-link-rewrite.html

 

Thanks Sham.

But does that mean there is no configuration way to rewriting asset links? And shouldn't explicit resourceResolver.map() call take care of this?

This seems too common a requirements to me and shouldn't have to write code for this.

 


We filled enhancement require way back in 5.3 & did not see much demand. As of know not out of the box option and you need write own transformer.