AEM SPA - Rewrite URL with Query Parameter not loading coz of incorrect .model.json call | Community
Skip to main content
Level 2
June 29, 2021
Solved

AEM SPA - Rewrite URL with Query Parameter not loading coz of incorrect .model.json call

  • June 29, 2021
  • 1 reply
  • 1671 views

We are in SPA with React implementation. 

We have product and category pages in our site which are being rendered dynamically. Hence, in AEM we just have one page for rendering category or product.

So, the actual page URL is  /en/category/categoryName but, using rewrites I have mapped it to /en/category.html?key=categoryName. But on dispatcher  I see there are 2 calls being made

en.model.json

categoryName.model.json

And, coz of this the page is not loading on dispatcher. Is there anyone else who faced this issue ? 

 

Dispatcher Log Entry -- >

/en/category.html?key=categoryName.model.json  

 

Env - AEM Cloud 

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 shelly-goel

@gunjan_13  Please refer to below where the similar issue is discussed.

You have two options:

1. Either you could fix :path property https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-spa-react-dispatcher-setup/qaq-p/383861

2. or I would suggest to use selector (/en/category.categoryName.html) to serve all category pages with single aem page. This would not require you to have a rewrite rule

1 reply

shelly-goel
Adobe Employee
shelly-goelAdobe EmployeeAccepted solution
Adobe Employee
July 1, 2021

@gunjan_13  Please refer to below where the similar issue is discussed.

You have two options:

1. Either you could fix :path property https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-spa-react-dispatcher-setup/qaq-p/383861

2. or I would suggest to use selector (/en/category.categoryName.html) to serve all category pages with single aem page. This would not require you to have a rewrite rule