Expand my Community achievements bar.

SOLVED

sling:target to /geohome on the /content node

Avatar

Level 7

Hi,

I just noticed that the /content node has the following two properties:

    sling:target = /geohome
    sling:resourceType = sling:redirect

Is it advisable to change these values for an in-production installation?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Yes please.

You need to update the property "sling:target" on the "/content" node OR configure RootMappingServlet. Configuring at /content you can activate through package.

You have two options:-

Option1:- At repository for publish run mode configure RootMappingServlet [1]. Steps would be

* Create /apps/<projectname>/config.publish/com.day.cq.commons.servlets.RootMappingServlet
* Define property rootmapping.target with value equal to home page path.
* Activate /apps/<projectname>/config.publish/com.day.cq.commons.servlets.RootMappingServlet

[1] http://<host>:<port>/system/console/configMgr/com.day.cq.commons.servlets.RootMappingServlet

Option 2:-
* Modify sling:target on the "/content" node of author.
* Create a package to include only content using exclude filters (attaching snapshot). Once the package is built. Activate the package & will get pushed to publish instance and get installed automatically. More samples of package filter at http://aemfaq.blogspot.com/2013/04/cq5-package-filter-includeexclude.html

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Yes please.

You need to update the property "sling:target" on the "/content" node OR configure RootMappingServlet. Configuring at /content you can activate through package.

You have two options:-

Option1:- At repository for publish run mode configure RootMappingServlet [1]. Steps would be

* Create /apps/<projectname>/config.publish/com.day.cq.commons.servlets.RootMappingServlet
* Define property rootmapping.target with value equal to home page path.
* Activate /apps/<projectname>/config.publish/com.day.cq.commons.servlets.RootMappingServlet

[1] http://<host>:<port>/system/console/configMgr/com.day.cq.commons.servlets.RootMappingServlet

Option 2:-
* Modify sling:target on the "/content" node of author.
* Create a package to include only content using exclude filters (attaching snapshot). Once the package is built. Activate the package & will get pushed to publish instance and get installed automatically. More samples of package filter at http://aemfaq.blogspot.com/2013/04/cq5-package-filter-includeexclude.html

Avatar

Level 7

Hi Sham,

Thanks for the reply. Could you please explain the purpose of the "sling:target" on the content node? I mean, if I open localhost:4502/content, it redirects to the given target, but what's the use case for this?

Avatar

Level 10

LinearGradient wrote...

Hi Sham,

Thanks for the reply. Could you please explain the purpose of the "sling:target" on the content node? I mean, if I open localhost:4502/content, it redirects to the given target, but what's the use case for this?

 

The destination of request for route ("/" alias landing page)  is decided by root mapping servlet (http://localhost:4502/system/console/configMgr/com.day.cq.commons.servlets.RootMappingServlet) based on run mode. OOB in author instance  it is /welcome & publish instance it is /content.   The /content does not have any resource to render & it redirect to vanity url so that page can be rendered.      We unnecessarily  introduced RootMappingServlet which could be well handled with vanity path with highest ranking might be in future release we will get rid of RootMappingServlet.   Make sense?