Vanity redirects using query parameters in the AEM page properites | Community
Skip to main content
Level 4
October 16, 2023
Solved

Vanity redirects using query parameters in the AEM page properites

  • October 16, 2023
  • 3 replies
  • 1881 views

Hi All,

 

vanity in page properties works fine i.e https://www.test.com/abc redirects to https://www.test.com/en/samplepage.html

 

but to make it redirect to with using query parameter , do we have any custom solution to manage from page properties

 

how we can append parameter fname=aa&lname=bb from page properties itself to make author driven 

 

i.e https://www.test.com/abc should redirect to https://www.test.com/en/samplepage.html?fname=aa&lname=bb or https://www.test.com/en/samplepage?fname=aa&lname=bb

 

 

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 Rohit_Utreja

@sonuk85184451 

 

'sling:vanityPath' do not support query params. You can go with below workarounds in this case.

  1. Set the rule in dispatcher directly.
  2. Use ACS common redirect manager and respect 'preserveQueryString' param in the configurations.
    https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-manager/subpages/advanced.html
    Using this, you can set a path as source in ACS commons redirect manager configs and target path can contain query params. 'or' if you want to pass queryparams from source to destination URL, it can be done as well.

 

Hope it helps!!

 

3 replies

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 16, 2023

Yeah, I think the 'sling:vanityPath' does not support query parameters. That's why you are not seeing those queryParams being appended.

Depending on your requirements, I think you could consider some of these approaches:

Hope this helps

Esteban Bustamante
Level 4
October 16, 2023

@estebanbustamante  - i found an article to use ACS common feature Redirect Manager

is this will be good option ? it says its cloud compatible

https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-manager/index.html

Rohit_Utreja
Community Advisor
Rohit_UtrejaCommunity AdvisorAccepted solution
Community Advisor
October 17, 2023

@sonuk85184451 

 

'sling:vanityPath' do not support query params. You can go with below workarounds in this case.

  1. Set the rule in dispatcher directly.
  2. Use ACS common redirect manager and respect 'preserveQueryString' param in the configurations.
    https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-manager/subpages/advanced.html
    Using this, you can set a path as source in ACS commons redirect manager configs and target path can contain query params. 'or' if you want to pass queryparams from source to destination URL, it can be done as well.

 

Hope it helps!!