Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM - Set External Page Redirect that carries Query Parameters

Avatar

Avatar
Level 1
vinceg62980830
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
vinceg62980830
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
vinceg62980830
Level 1

16-04-2018

Hi everyone,

Not sure if anyone else had come across this similar situation...

We want to leverage the "Page Redirect" placeholder page, or even the Redirect field in a page's Page Properties, to setup a "single/global redirect" to a sister website. However, we need to be able to pass-thru query parameters during that redirect.

So for example:

AEM == https://www.mysite.com/

Sister site == https://www.sistersite.com/

We'd like to have URLs that point to the sister site, and rather than always manually inputting their URL we'd like to setup an AEM webpage that redirects, so:

AEM page == https://www.mysite.com/content/gotosister --> https://www.sistersite.com/

The kicker is, current redirects using either the "Page Redirect" placeholder page or the Page Properties redirect strips out any Query Params that may be on it. Is there a way for it to retain/pass-thru query params? So:

https://www.mysite.com/content/gotosister?param=foo --> https://www.sistersite.com/?param=foo

Replies

Avatar

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

273 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

273 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
edubey
Level 10

16-04-2018

You properly would have to overlay this file  /libs/foundation/components/page/redirect.jsp or /libs/wcm/foundation/components/page/redirect.html and correct logic for your use case. Doesn't seems to be much of work.

Avatar

Avatar
Level 1
vinceg62980830
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
vinceg62980830
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
vinceg62980830
Level 1

19-04-2018

Thanks for responding, @edubey.

I see that the HTL is already appending .html to the path:

<p data-sly-test="${properties.redirectTarget}" class="cq-redirect-notice">

    This page redirects to <a href="${properties.redirectTarget}.html">here</a>

</p>

how would we pass params after that appended .html portion?