Expand my Community achievements bar.

SOLVED

AEM Adaptive Forms - Thank you pages redirect

Avatar

Level 2

Hi everyone,

I see that he guideContainer OOTB component has a Thank you tab with a field to select the path to redirect the page. I overlayed this component to add more fields in the dialog to redirect to different pages based on a selector field in the form.

So till this point, everything looks good and the pages are being redirected accordingly to the user choice.

The issue there I am seeing is that after redirecting the page, the URL displays the "/content" even though the internalRedirects are configured in etc/mapping.

Example:

The URL :

example.com/content/thankyou;html

Should be: example.com/thankyou;html

Does this happen by design? Isn't this a security problem?

Also, this happens with the OOTB component as well.

Please let me know if there is a solution to this.

Thank you,

Greetings

1 Accepted Solution

Avatar

Correct answer by
Level 10

sling:internalRedirect would simply resolve the url within AEM and wouldn't modify the url in browser. The onus is on the application's architecture & design including SEO best practices.

OOB AEM author and publish have different configurations by design, hence /content is mandatory to resolve in author but not in the publish instance. However, you could modify OOB configurations based on the requirements.

Based on project's /etc/mappings that you've already configured, you may use external redirects, sling:redirect or sling resourceresolver mappings or a combination of these.

sling internal redirect - sling:internalRedirect  string[]  "some value"   

sling redirect - sling:redirect  string "some value"

The difference is that sling:redirect would cause an external redirect where you could maintain the status(301/302 for SEO) and it would also modify the url in the browser.

Apache Sling :: Mappings for Resource Resolution

the classic example is available OOB in publish server, check the URL Mappings in /system/console/configMgr and you would find -

/content/:/     - it means that /content would resolve to root / on the publish server itself which is not the case with author instance OOB configuration. Hence, localhost:4503/content/thank-you.html would also render same as localhost:4503/thank-you.html

It also provides a description about the bidirectional resolution.

1670573_pastedImage_4.png

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

sling:internalRedirect would simply resolve the url within AEM and wouldn't modify the url in browser. The onus is on the application's architecture & design including SEO best practices.

OOB AEM author and publish have different configurations by design, hence /content is mandatory to resolve in author but not in the publish instance. However, you could modify OOB configurations based on the requirements.

Based on project's /etc/mappings that you've already configured, you may use external redirects, sling:redirect or sling resourceresolver mappings or a combination of these.

sling internal redirect - sling:internalRedirect  string[]  "some value"   

sling redirect - sling:redirect  string "some value"

The difference is that sling:redirect would cause an external redirect where you could maintain the status(301/302 for SEO) and it would also modify the url in the browser.

Apache Sling :: Mappings for Resource Resolution

the classic example is available OOB in publish server, check the URL Mappings in /system/console/configMgr and you would find -

/content/:/     - it means that /content would resolve to root / on the publish server itself which is not the case with author instance OOB configuration. Hence, localhost:4503/content/thank-you.html would also render same as localhost:4503/thank-you.html

It also provides a description about the bidirectional resolution.

1670573_pastedImage_4.png