React Components // SPA // Url Shortening | Community
Skip to main content
sudeshb1607
Level 2
Nov 17, 2020 6:16 PM UTC
Solved

React Components // SPA // Url Shortening

Hi,

 

We are creating react components based on SPA framework but we have extended it to be multi-page applications using react based component. Now we want to implement URL shortening. for that, we are creating a mapping in jcr resource resolver mapping and rewrite rules to hide "/content/XXX". Now when we are making a request to page without /content/XXX/en/abc.html like /en/abc.html then all calls are 200 included model.json for the page but the react components are not able to map it where if I make a request /content/XXX/en/abc.html then the same response is coming back but the page is getting rendered.

 

So is there i way that we can implement url shortening for react SPA framework(from official documentation, I understand that this feature is not supported OOTB) but is there any other alternative which we can use to implement the URL shortening.

 

Thanks,

Sudesh

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

8 replies

Level 2
Feb 15, 2021 12:48 PM UTC

@sudeshb1607 , Did you get any solution for the issue? I am also facing same issue.

Translate
New Participant
Sep 6, 2021 11:08 AM UTC

Hi @nasrinj114 , @sudeshb1607 ,

 

Did you manage to solve the issue?

Translate
Level 2
Sep 6, 2021 12:29 PM UTC

Yes, I gave custom implemetation to the HierarchyPageImpl class and removed "/content/project-name/en" from getExportedPath() method if it is in publish mode. (fetch runmode slingSettingsService.getRunModes()).

Also removed  removed "/content/project-name/en" from all the routing links if it is in publish mode.

Translate
Level 2
Feb 10, 2021 2:50 PM UTC

we have used vanity URL feature provided by AEM, worked pretty well for us

Translate
shelly-goel
Employee
Nov 18, 2020 5:20 PM UTC

@sudeshb1607To me it looks like the reverse mapping is not happening i.e. the subsequent requests are not mapped to the domain. Try adding Sling mappings (/etc/map entries) and that should hopefully take care of reverse mapping.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Nov 17, 2020 8:32 PM UTC