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

后端 未结 2 1595
清酒与你
清酒与你 2021-01-24 05:10

I basically want short URLs to get resolved and HTML pages to be generated with short URLs for a CQ5 website. So far short URLs are getting mapped to long URLs as expected, but

相关标签:
2条回答
  • 2021-01-24 05:38

    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.

    0 讨论(0)
  • 2021-01-24 05:46

    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.

    0 讨论(0)
提交回复
热议问题