In this article we will discuss on how we can configure a Externalizer and use it in AEM code. Lets understand what is the use of Externalizing the URLs.
Externalizer is an OSGI service using which we can update a resource path (e.g. /content/mycompany/my/page ) into an external and absolute URL (for example, https://www.mycompany.com/content/mycompant/my/page ) by prefixing the path with a pre-configured DNS.
As the instance in which the application is running can’t know its externally visible URL if it is running behind a web layer, and because sometimes a link has to be created outside of the request scope, this service provides a central place to configure those external URLs.
Navigate to /system/console/configMgr and configure the URL you want to use as part of externalizer by mapping it in Domains option.