Symptoms
When accessing my author via dispatcher (http://myauthor.mycompany.com
), the Link Checker Service adds internal links to the external links list.
Cause
Some responses created by CQ WCM include the referer information (any code that uses the HtmlResponse, such as SlingPostServlet). This referrer is then a fully qualified URL including "http" or "https", which is then treated as external link.
Resolution
Add an exception to the link checker to tell it to ignore all URL patterns for hostnames that are used to access the author instance through the dispatcher. To do this, do the following:
- Log into
http://[host]:[port]/crxde
as admin - If you do not already have a custom link checker configuration in your application then copy the node
/libs/cq/linkchecker/config.author/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl
to/apps/[yourapp]/config.author/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl
- Select the config node
com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl
- On the bottom of the right pane, expand the Properties tab
- Double click
service.check_override_patterns
- Add another override pattern for the URL that is being marked invalid
For Example: if the broken links are all URLs with the hostnamecq5author.mycompany.com
, then your override pattern would be:^http://www.mycompany.com/.*
- Delete any nodes under
/var/linkchecker
corresponding to the invalid link's host
For Example: following the example in the last step, we would delete/var/linkchecker/http/cq5author.mycompany.com
- Click Save All
Note: [host]
and [port]
above refer to the hostname and port of your CQ5 author server. [yourapp]
refers to the name of your CQ5 application under /apps
.
WARNING: If you apply this configuration and your users accidentally create links that point to http://cq5author.mycompany.com/...
instead of using the path then these links will be broken in your publish instance. To avoid this problem, please notify your authors that they must use paths for all internal links.
Applies to
CQ 5.X