Sling:alias not working on dispatcher | Community
Skip to main content
Level 2
December 4, 2015
Solved

Sling:alias not working on dispatcher

  • December 4, 2015
  • 13 replies
  • 6634 views

Hi,

I have a question about "sling:alias". I have a few pages with a sling:alias configured. During development everything works and when we publish the page, the page is available and can be opened on the publish instance. As I'm setting up the dispatcher and configuring the sling mappings (/etc/map/) I noticed that the pages can't be resolved using the sling alias. When I tested the page on the publish again, when I wasn't logged in, I couldn't retrieve the page as well. It seems like I have to allow access to the page, I already configured access to the content root for the website.

When reading through the documentation I noticed that the SlingGetServlet does not allow anonymous requests that retrieve html pages, this could be the cause of my problem.

Im wondering what the best solution is to allow the sling:alias to be used from the dispatcher? Is there a configuration setting to allow a tree of pages?

Regards

Steven

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 StevenRymenans

Another update: I debugged the sling engine code to determine when the alias was resolved and the sling code tries several strategies to resolve the content node, one of them is starting at the root node ('/') and adding everything until the path is resolved or an alias is found in the aliasMap. Granting the anonymous user access to root ('/') solves the issue.

I should add that the hotfix cq-6.1.0-hotfix-7700-2.2.zip is also necessary for this to work.

Everyone who tried to help, thank you very much. I'm glad this issue is resolved, on to the next one!

Regards

Steven

13 replies

Level 2
December 8, 2015
        After trying to reproduce the issue on a new publish instance I noticed that a request filter is also not working. Is it possible that some filters are disabled?
Level 2
December 8, 2015

Update: I am able to reproduce the issue on a "new" publish instance, I also installed all the hotfixes for AEM 6.1 just to make sure that isn't an old problem.

I changed the Sling Authentication to allow anonymous access. I even gave the anonymous user access to read/write/.... for all the paths using the useradmin screen, but still the sling:alias is not resolved.

I'm going to set logging for sling on debug now and hopefully I can extract the issue from the log file.

StevenRymenansAuthorAccepted solution
Level 2
December 8, 2015

Another update: I debugged the sling engine code to determine when the alias was resolved and the sling code tries several strategies to resolve the content node, one of them is starting at the root node ('/') and adding everything until the path is resolved or an alias is found in the aliasMap. Granting the anonymous user access to root ('/') solves the issue.

I should add that the hotfix cq-6.1.0-hotfix-7700-2.2.zip is also necessary for this to work.

Everyone who tried to help, thank you very much. I'm glad this issue is resolved, on to the next one!

Regards

Steven