Setting Context Path for each site within AEM | Community
Skip to main content
July 6, 2017
Solved

Setting Context Path for each site within AEM

  • July 6, 2017
  • 2 replies
  • 3793 views

Hi,

We would like to create different application context paths for each of the sites hosted within AEM.

The below are the snapshots as how the context path must be rendered for root node of the AEM content (/content), design node that the page uses (/etc/designs) and /bin folder for servlets paths to render for the page.

Context Path 1:

/career

     /career/content/site

     /career/etc/designs/career/site

     /career/bin/<servlet paths>

Context Path 2:

/careerAdmin

     /careerAdmin/content/site/admin

     /careerAdmin/etc/designs/career/site/admin

     /careerAdmin/bin/<servlet paths>

We have tried to achieve this by setting the felix context-path to the specific run-mode.

/apps/config.<runmode>/org.apache.felix.http

[jcr:primaryType = sling:OsgiConfig]

  [org.apache.felix.http.context_path = "/career"]

The problem with this approach is that it is applying this config for the whole AEM and this setting is applied for all the sites within AEM. We would like to segregate this, so that every site will have it's own context path as per the above snapshots and corresponding content gets rendered for both the sites.

We run AEM 6.2 standalone via CRX quickstart. An suggestions/solution to address the above mentioned issue would be helpful.

Regards

Sudhakar

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 Techaspect_Solu

Hi Sudhakar02,

This type of scenario is not possible.

All your invalidation will happen only at /content ,/etc level and not otherwise.

If you are deploying aem as an application inside any application server , then there is a chance of deploying "career"/"careerAdmin" as a root context for the app server using url-rewriting or we can do same in aem using tuckey.Please refer[0]

[0]: http://tuckey.org/urlrewrite/

For the servlet,user can add custom name under "Apache Sling Servlet/Script Resolver and Error Handler" from the config manger.

Thanks,

Techaspect Solutions Pvt Ltd.

2 replies

viveksachdeva
Community Advisor
Community Advisor
July 11, 2017

Looking at Apache Felix - Apache Felix HTTP Service , doesnt look seem possible using the config properties

Techaspect_Solu
Techaspect_SoluAccepted solution
July 11, 2017

Hi Sudhakar02,

This type of scenario is not possible.

All your invalidation will happen only at /content ,/etc level and not otherwise.

If you are deploying aem as an application inside any application server , then there is a chance of deploying "career"/"careerAdmin" as a root context for the app server using url-rewriting or we can do same in aem using tuckey.Please refer[0]

[0]: http://tuckey.org/urlrewrite/

For the servlet,user can add custom name under "Apache Sling Servlet/Script Resolver and Error Handler" from the config manger.

Thanks,

Techaspect Solutions Pvt Ltd.