configure default publish instance url | Community
Skip to main content
Level 4
February 1, 2016
Solved

configure default publish instance url

  • February 1, 2016
  • 5 replies
  • 11681 views

Hi,

After publish instance up, With no sample data it is redirecting to (http://localhost:4503/geohome.html).

I want to redirect it to my home page. Where should I make changes, to bring my site after the startup of publish instance.

Pls help me out.

Regards

Krishh

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 kautuk_sahni

HI 

Please refer to this community article written by Lokesh :- 

Link:- http://adobeaemclub.com/root-mapping-configuration-in-adobe-aem/

Root Mapping Configuration in Adobe AEM

//

In Adobe AEM, when you hit http://<host>:<port>/ by default it is redirected to

Author: /projects.html (AEM 5.6.1 and above)

Publish: /content.html


How it works ?

“com.day.cq.commons.servlets.RootMappingServlet” – is responsible to redirect to the set root URL configure using the property called “rootmapping.target”

If you go to http://<host>:<port>/system/console/configMgr in each of the instance, you would see the above mentioned paths and hence the behaviour.

RootMapping Author
RootMapping Author

 

RootMapping Publish
RootMapping Publish

In author instance its straight forward but if you see publish instance, though its configured as ‘/content.html’ it redirects to ‘geometrixx-outdoors’ hompage reason being the 2 properties which is set for the node ‘/content’.

sling:resourceType as sling:redirect and

sling:target as /geohome (/geohome is the vanityURL for /content/geometrixx-outdoors)


How to change ?

Most likely, we would want to change the root mapping from /geohome to our own application in the publish instance and the same can be done in below mentioned ways

/content :

We know, in publish instance root mapping is set to /content.html. So go to /content node in crx de. Change the URL for the property sling:target to map to your own application content node and save. Package the same from the author instance and deploy it on the publish instance.

Note: when you package it and add the /content as the filter, make sure you add ‘exclude’ rule as ‘/content/*’ so that it doesnt include the child pages of the content node.

Package Manager Filter
Package Manager Filter

 

configMgr :

Login to the config manager console directly either in author or publish which you want to change, search for ‘Day CQ Root Mapping’ and change the ‘Target Path’ and click on Save. Next time when you access instance, it should redirect to the configured path.

custom config :

  • Create /apps/<projectname>/config.<runmode>/com.day.cq.commons.servlets.RootMappingServlet (runmode = author or publish)
  • Add a property rootmapping.target with value equal to home page path.
  • Activate or deploy /apps/<projectname>/config.<runmode>/com.day.cq.commons.servlets.RootMappingServlet

Refer OSGi Configuration to understand how to create the config files for each runmode

This approach would be best as it does not need any manual configuration across your instances and it get deployed to any instance as part of your project deployment.

 

 

Another Reference Article:- http://cq-ops.tumblr.com/post/17381263969/how-do-i-configure-my-own-site-and-not-geometrixx

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni

5 replies

Lokesh_Shivalingaiah
Level 10
February 1, 2016

Krishh,

for node '/content' there are 2 properties

sling:resourceType as sling:redirect and

sling:target as /geohome

change '/geohome' to the path for your application and replicate the same to publish instance. This should solve your problem.

 

Regards,

bsloki

Adobe Employee
February 1, 2016

You can also use the root mapping servlet to do this

http://localhost:4502/system/console/configMgr/com.day.cq.commons.servlets.RootMappingServlet

Regards,

Opkar

Lokesh_Shivalingaiah
Level 10
February 2, 2016

Krishh,

You can also refer [1] for more details and options

[1] http://adobeaemclub.com/root-mapping-configuration-in-adobe-aem/

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
February 2, 2016

HI 

Please refer to this community article written by Lokesh :- 

Link:- http://adobeaemclub.com/root-mapping-configuration-in-adobe-aem/

Root Mapping Configuration in Adobe AEM

//

In Adobe AEM, when you hit http://<host>:<port>/ by default it is redirected to

Author: /projects.html (AEM 5.6.1 and above)

Publish: /content.html


How it works ?

“com.day.cq.commons.servlets.RootMappingServlet” – is responsible to redirect to the set root URL configure using the property called “rootmapping.target”

If you go to http://<host>:<port>/system/console/configMgr in each of the instance, you would see the above mentioned paths and hence the behaviour.

RootMapping Author
RootMapping Author

 

RootMapping Publish
RootMapping Publish

In author instance its straight forward but if you see publish instance, though its configured as ‘/content.html’ it redirects to ‘geometrixx-outdoors’ hompage reason being the 2 properties which is set for the node ‘/content’.

sling:resourceType as sling:redirect and

sling:target as /geohome (/geohome is the vanityURL for /content/geometrixx-outdoors)


How to change ?

Most likely, we would want to change the root mapping from /geohome to our own application in the publish instance and the same can be done in below mentioned ways

/content :

We know, in publish instance root mapping is set to /content.html. So go to /content node in crx de. Change the URL for the property sling:target to map to your own application content node and save. Package the same from the author instance and deploy it on the publish instance.

Note: when you package it and add the /content as the filter, make sure you add ‘exclude’ rule as ‘/content/*’ so that it doesnt include the child pages of the content node.

Package Manager Filter
Package Manager Filter

 

configMgr :

Login to the config manager console directly either in author or publish which you want to change, search for ‘Day CQ Root Mapping’ and change the ‘Target Path’ and click on Save. Next time when you access instance, it should redirect to the configured path.

custom config :

  • Create /apps/<projectname>/config.<runmode>/com.day.cq.commons.servlets.RootMappingServlet (runmode = author or publish)
  • Add a property rootmapping.target with value equal to home page path.
  • Activate or deploy /apps/<projectname>/config.<runmode>/com.day.cq.commons.servlets.RootMappingServlet

Refer OSGi Configuration to understand how to create the config files for each runmode

This approach would be best as it does not need any manual configuration across your instances and it get deployed to any instance as part of your project deployment.

 

 

Another Reference Article:- http://cq-ops.tumblr.com/post/17381263969/how-do-i-configure-my-own-site-and-not-geometrixx

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
Level 4
February 2, 2016

Thanks a lot for the info.