Redirect in AEM SPA React | Community
Skip to main content
New Participant
July 25, 2023
Solved

Redirect in AEM SPA React

  • July 25, 2023
  • 1 reply
  • 699 views

We have a requirement to internally redirect, so when an users access the old page hierarchy they view data a new page hierarchy in the SPA. This would ensure that the Old URLs does not need to be updated with the new page URLs and continue using Old URLs.

 

In traditional AEM implementations, we achieve this by configuring internal redirects in the dispatcher, as shown below:

 

RewriteRule ^/old-sample-page/([a-zA-Z0-9-]+).html /content/new-sample-page/$1.html [PT,L]

 

However, when we try the same logic for the SPA, the pages appear blank even though the redirects work fine. The rules used are as follows:

 

RewriteRule ^/old-sample-page/([a-zA-Z0-9-]+).html /content/new-sample-page/$1.html [PT,L] RewriteRule ^/old-sample-page/([a-zA-Z0-9-]+).model.json /content/new-sample-page/$1.model.json [PT,L]

 

 

Do we need to make any other changes in dispatcher or SPA routing?

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 Shashi_Mulugu

@hemanth28 you shuld be the same. Can you please cross check your incoming request against any conditions or vhost file domain you have.

In general outside spa, we will have rewrites w.r.t htmls, so please cross check which vhost it is executing and which rewrite condition inorder it is executing.

1 reply

Shashi_Mulugu
Shashi_MuluguAccepted solution
New Participant
July 27, 2023

@hemanth28 you shuld be the same. Can you please cross check your incoming request against any conditions or vhost file domain you have.

In general outside spa, we will have rewrites w.r.t htmls, so please cross check which vhost it is executing and which rewrite condition inorder it is executing.