Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

AEM links not mapped when page does not exist


Level 3



I have a problem with AEM links rewriting. I have a set of mappings that works correctly for my site. All links in content are mapped nad works fine.


The problem happened when my component (for example core components RTE) links to a page that is not published. In that case link is not mapped and I can see in cached HTML file that the link is `/content/my-site./en/not-existing` isntead of `/en/not-existing`. When I publish `not-existign` page and clear cache link is correctly mapped.


Is that a new feature of AEM / Sling mappings? Can I change that ? I would like to avoid having unmapped links even if they points to 404 page. 


AEM 6.5.9


Link checker transformer config:

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"


2 Replies


Community Advisor

Hi @bartek_887, I did quick check on my local AEM instance. I was able to configure sling mappings in the way, that all the links including the one that are pointing to not existing pages are correctly mapped/rewritten. I have used OOTB we-retail for that exercise.

Below is the mapping configuration I have tested. I have also used exactly the same Day CQ Link Checker Transformer to the one you have provided in your message.

<?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"

Alternatively you can consider to enable checking functionality of Link Checker, in that case broken/not existing links will not be shown at all. To do this you need to change linkcheckertransformer.disableChecking to false.


Level 3

Could you please let me know what exactly did you check? It seems that this problem is related to `.html` extension in the mapped link. Behaviour I noticed:

  • When component renders link with `.html` extension it is always mapped
  • When component renders link without .html extension the link is mapped only when link page actually exists
    • link to existing page is mapped
    • link to not existing page is not mapped
    • This can be tested with Core Components Text component (I removed .html manually from CRX for the purpose of the test)