What am I missing for this CQ5/AEM URL rewriting scenario?

 ̄綄美尐妖づ 提交于 2019-12-02 05:10:07

By default, CQ rewrites links in a, area and form tags. If you'd like to rewrite also paths in script tag, open OSGi configuration for LinkCheckerTransformerFactory service on publish and add following string to the Rewrite Elements option:

script:src

BTW: /content is not the best place for storing clientlibs. Usually we put this stuff in /etc/designs/YOUR_APP.

We finally managed to pinpoint the issue and fix this.

Somebody had added a com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl.xml under /apps/myapp/config.publish with the following content:

<?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"
    service.bad_link_tolerance_interval="{Long}48"
    service.check_override_patterns="[^.]"
    service.special_link_patterns=".*&#xa;"
    service.special_link_prefix="[javascript:,data:,mailto:,#,&lt;!--,${]"/>

I think the combination of check_override_patterns and special_link_patterns had disabled link shortening.

Removing this file made link shortening work again.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!