Sling:alias not working on dispatcher | Community
Skip to main content
New Participant
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

Feike_Visser1
Employee
December 7, 2015

Do you see anything in the AEM-logs when requesting it from the dispatcher?

You should see something in the access.log / error.log

New Participant
December 4, 2015

Hi,

 

This link describes that a "production-ready" aem secures the sling get servlet: https://docs.adobe.com/docs/en/aem/6-1/administer/security/production-ready.html

I don't know whether this could be the cause of my issue.

The publish is indeed setup with anonymous access and I am able to request every page of my website. But when I try to access the page using it's "sling:alias" the page is not found.

 

Regards,

Steven

Employee
December 4, 2015

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.

Can you provide the link for this please. 

The publish instance is set up to give anonymous access, so not sure why you are required to log in to access a page, unless you have specifically setup authentication for a content path.

Vanity URL's are usually an issue in Dispatcher as they often do not follow the allowed patterns for passing through requests. 

Regards,

Opkar