Wednesday, April 18, 2018

How to implement extension-less URL's in Adobe Experience Manager(AEM)

How to implement extension-less URL's in Adobe Experience Manager(AEM)

As per the SEO best practices it is better to define extension less URL's to boost the ranking, AEM require the extension to understand and serve incoming request.

This post explains the approach to achieve the extension less URL in Adobe Experience Manager(AEM)

There are two steps

- Rule Configuration Dispatcher
       Remove .html extension from incoming URL with /
Append the .html while invoking the publisher for the URL's ending with /

- AEM etc/map configuration
      Reverse mapping to rewrite the html URL in the pages to extension less
      Forward mapping to map the incoming request to resource

This is tested in AEM 6.2 version

Apache configurations:

#Handle the landing page
RewriteRule ^/$ /en/ [R=301,L]
#Mask the /content/geometrixx-outdoors path
RewriteRule ^/content/geometrixx-outdoors/(.*)(\.html)?$ /$1 [NE,L,R=301]

#Replace the .html with /
RewriteCond %{REQUEST_URI} \.html$
RewriteRule ^/(.*).html$ /$1/ [R=301,L,QSA]

#Append the .html for those URL's ending with / before sending to publisher
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^/(.*)/$ /$1.html [PT,L,QSA]

Publisher etc/map configurations:

Create a node localhost.8080(replace with required DNS and port) of type sling:Mapping under /etc/map/http or /etc/map/https based on the protocol used

Add the following property

sling:internalRedirect[] - /content/geometrixx-outdoors

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="" xmlns:jcr=""


Sunday, April 1, 2018

Different approaches to perform Vanity/Redirect URL management in Adobe Experience Manager(AEM)

Different approach to perform Vanity/Redirect URL management in Adobe Experience Manager(AEM)

In Adobe Experience Manager there is no centralized management UI to manage the Vanity/Redirect URL's also the vanity/Redirects are added into multiple places like Apache and AEM.

This post will explain the different approach to manage the Vanity/Redirect URL through centralized management UI.

Option1: Manage the Vanity URL's through VanityPath page property

  • Build a UI application to read vanityPath properties from the repository content nodes and enable management options - Add, Delete, Modification
  • Refer the following URL for details on this approach - working in 6.1)
  • Whitelist vanity paths in dispatcher -
The same approach can be followed to manage the redirect path enabled in AEM

Vanity URL's are handled in AEM so all the request reaches AEM publisher

Option2 - Manage the Vanity/redirects through AEM UI on XML and redirect through Java Filter


Store the vanity and redirects mapping in a XML file with in AEM repository



  • Build a UI application to manage the redirects in the file - modify/remove and add new rules
  • Replicate the mapping XML to publisher on every modification through replication API
  • Build a Java filter that will redirect to the target URL if the vanity path is defined in the XML file(the filter should be restricted only required path)
  • Whitelist the vanitypaths in Apache – Expose the vanitypaths through custom URL(Servlet expose the list of vanity URLs by parsing the XML) and configure the URL in Apache for whitelisting(Refer for apache configuration, the vanity list URL should be custom)

Vanity/Redirects are handled in AEM so all the request reaches AEM publisher

Wednesday, March 21, 2018

How to resolve Adobe Experience Manager(AEM) pointing to Search and Promote(S&P) Stage environment?

How to resolve Adobe Experience Manager(AEM) pointing to Search and Promote(S&P) Stage environment?

Recently i have faced a issues on AEM publisher pointing to Search and Promote(S&P) stage environment irrespective of the environment configuration in OSGI configuration( Adobe Search&Promote Integration )


How to confirm AEM is pointing to S&P stage environment:

Check the content of searchformxml property from /etc/cloudservices/search-promote/<<S&P Config Name>>/jcr:content and check the <action> URL

Stage - <action></action>
Live - <action></action>


The following steps can be followed as a workaround:

Decode the data if it is already encoded(HTML Decoder) - searchformxml property from /etc/cloudservices/search-promote/<<S&P Config Name>>/jcr:content

Remove <input type="hidden" name="sp_staged" value="1" />

Change the following URLs to point to live configuration

// to //
// to //

Change the action to point to live URL

<action></action> to <action></action>

e.g - this will be different based on your S&P configuration

<css><![CDATA[<link rel="stylesheet" type="text/css" href="//" />]]></css>
<form-content><![CDATA[<div id="autocomplete"></div>]]></form-content>
<javascript><![CDATA[<script type="text/javascript" src="" ></script>
<script type="text/javascript" src="" ></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="//"></script>]]></javascript>
</autocomplete> <tnt> <enabled>0</enabled> <form-content><![CDATA[<div id="tntMBox"></div>]]></form-content> <javascript><![CDATA[<script type="text/javascript">
(function(){var searchTextBoxId='q';var mboxContainerId='tntMBox';var mboxName='searchParamMbox';function removeEventSimple(obj,evt,fn)
obj.removeEventListener(evt,fn,false);else if(obj.detachEvent)
function addEventSimple(obj,evt,fn)
obj.addEventListener(evt,fn,false);else if(obj.attachEvent)
function setSearchFormMbox()
var el=document.getElementById(searchTextBoxId);if(el)
]]></javascript> </tnt> <form>

If the same S&P configuration with live option is enabled in any other server then copy and replace the value of searchformxml in /etc/cloudservices/search-promote/<<S&P Config Name>>/jcr:content

I have faced this issue in Adobe Experience Manager(AEM) 6.2 version

Tuesday, March 20, 2018

Different approaches to calculate content/DAM folders size in Adobe Experience Manager(AEM)

Different approaches to calculate content/DAM folders size in Adobe Experience Manager(AEM)

In Adobe Experience Manager(AEM), there is no direct approach to get the size of the specific content node or DAM.

This post explains the different approach to calculate the size for specific content or DAM path

Creating package through package manager:

Create the package through package manager for specific content/DAM path.
Build and download the package and calculate the size.



This approach will create space issue in server while creating the packages.

Calculate size through WebDav client:

Use any WebDav client to calculate the size of the DAM folders, I have used WinScp tool for size calculation




This approach
- Can be only used for DAM assets as HTML contents are mapped as folders in WedbDav(AEM configuration)
- Can be only used in WebDav enabled AEM instances

Monday, March 12, 2018

Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;Jcr2davRepositoryFactory

I was getting the below exception while connecting to AEM JCR repository through Java API(JCR webdav) using Jcr2davRepositoryFactory.

Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
at org.slf4j.impl.Log4jLoggerAdapter.debug(
at org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory$RepositoryConfigImpl.getCacheBehaviour(
at org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory$RepositoryConfigImpl.<init>(
at org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory.getRepository(
at org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory.getRepository(
at workarea.core.GetRepositorySize.main(

To fix the issue add the slf4j-log4j12 with lower version and also exclude jcl-over-slf4j from jackrabbit-jcr2dav dependency.

<!-- -->