Hi, AEM SPA application doesn't load when we change the URL through redirect or link shorting. Example, changing link from localhost:4502/content/project/us/en/pagename.html to localhost:4502/us/en/pagename.html. Page doesn't throw error but it's just blank page.
I saw some other questions on this forum explaining to change HierarchyPage model method getExportedPath().
Based on Google Search I came across HierarchyPage class.
I have changed the getExportedPath().
public String getExportedPath() {
System.out.println(currentPage.getPath());
String pagePath = currentPage.getPath();
if(pagePath.contains("/content/project")){
String trimmedPagePath = pagePath.replace("/content/project","");
return trimmedPagePath;
}
else{
return currentPage.getPath();
}
}
but still redirect or page sortlink doesn't work. Is this the correct implementation? or can someone share their custom page model implementation for the spa redirect/linkShorting.
Solved! Go to Solution.
Please have a look to implement url shortening in aem react spa http://experience-aem.blogspot.com/2021/10/aem-cloud-service-url-shortening-of-react-spa.html
Please have a look to implement url shortening in aem react spa http://experience-aem.blogspot.com/2021/10/aem-cloud-service-url-shortening-of-react-spa.html
Hi @DPrakashRaj
I tried above sample project mentioned in the article, but as soon we change the hierarchical structure depth to 0, in template page policy. It stops working.
@snowwhite92did you found any solution to get it working?
Views
Replies
Total Likes
Views
Likes
Replies