April 3, 2020
Estimated Post Reading Time ~

How to configure Internal and External Redirects in CQ5

There are multiple ways in CQ to redirect you to any page internally or externally. One of the most common of them is using Vanity URLs. They are easily editable and the authors can also tweak them on the fly. However, they are not manageable due to the fact that they can be configured on the page individually.

So, if you consider managing these URLs a herculean task, don’t panic, there are other shorter and simpler ways by which you can redirect the user to internal as well as external sites.

I wanted to attach a package with redirect contents but my free WordPress account does not allow me to add a zip file. So, I have illustrated the approach in layman language hope this will clarify the redirection process.

create node http(jcr:primaryType="sling:OrderedFolder") //below map on http node
create node internal_redirect
jcr:primaryType="sling:Mapping"
sling:internalRedirect=/content/geometrixx/en/community.html ->Type String //internal redirect
sling:match=\[^/]+/content/geometrixx/en/events.html -> Type String

create node external_redirect
jcr:primaryType="sling:Mapping" sling:redirect=http://www.google.com - >Type String // external redirect
sling:match=\[^/]+/content/geometrixx/en/toolbar.html -> Type String



By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.