URL shortening in AEM 6.3 | Community
Skip to main content
Level 5
December 7, 2017
Solved

URL shortening in AEM 6.3

  • December 7, 2017
  • 3 replies
  • 5238 views

in AEM 6.3, we define the URL mapping in the JcrResourceResolverFactoryImpl.config.xml file. When author selects a content URL as a path in the component dialog,

if we render the url as <a href="${link.url@ extension = 'html'}">, the AEM automatically shortens the url. However, if we remove the extension <a href="${link.url}">, the AEM doesn't shorten the URL.

Just wonder if anyone knows if there is a linker check related configuration to tell adobe only shorten the url when the path has .html?

Thanks.

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 joerghoh

The URL shortening is a function of the LinkRewriter, and this rewriter acts only links containing an extension. If you omit the extension (e.g. ".html") it's not rewritten.

Jörg

3 replies

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
December 7, 2017

The URL shortening is a function of the LinkRewriter, and this rewriter acts only links containing an extension. If you omit the extension (e.g. ".html") it's not rewritten.

Jörg

Hemant_arora
Level 8
December 8, 2017

Add an exception to the link checker to tell it to ignore certain URL patterns. To do this, do the following:

  1. Log into http://[host]:[port]/crxde as admin
  2. 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/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl
  3. Select the config node com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl
  4. On the bottom of the right pane, expand the Properties tab
  5. Double click service.check_override_patterns
  6. Add another override pattern for the URL that is being marked invalid
    For Example: if the broken links are all URLs with the hostname www.mycompany.com, then your override pattern would be: ^http://www.mycompany.com/.*
  7. 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/www.mycompany.com
  8. Click Save All
BigT168Author
Level 5
December 12, 2017

Thanks Hermant.

I think Jörg answered my question. Your approach will work for single site, I have multiple sites, don't want to put something only applying for one site.

Thanks again.