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
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=".*
"
service.special_link_prefix="[javascript:,data:,mailto:,#,<!--,${]"/>
I think the combination of check_override_patterns
and special_link_patterns
had disabled link shortening.
Removing this file made link shortening work again.