Expand my Community achievements bar.

SOLVED

Redirect in AEM SPA React

Avatar

Level 1

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@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.