AEM SPA URL Shortening | Community
Skip to main content
Level 6
May 28, 2023
Solved

AEM SPA URL Shortening

  • May 28, 2023
  • 1 reply
  • 1371 views

Hi,

 

I had to shorten the URL from the dispatcher, which I succeeded, but I could not view the page content on the shortened URL, but when the URL wasn't shortened, I could view the content similar to Publisher. 

 

Please guide me on how to make the page visible on Dispatcher with shorten URL.

 

 

Thanks

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 Ronnie09

Hi @ronnie09 

is this issue resolved? if yes, can you please mention the steps you did to get it working?

 

Thanks.


Hi @iamnjain 

This issue was resolved by the react team they handled via some routing element. AEM inputs are not that much required. I am also not exactlty aware what changes were made by react team.

1 reply

lukasz-m
Community Advisor
Community Advisor
May 28, 2023

Hi @ronnie09,

You will need to add appropriate rewrite rules on Apache level, as a complementary part for short urls.

Here is the example. There is following content structure:

/content /spa-site /en /home /faq

Given structure should be accessible under below short urls, without html extension:

/content/spa-site/en/home -> https://domain/en/home /content/spa-site/en/home/faq -> https://domain/en/home/faq

For above following Apache rewrite rules are applicable

RewriteEngine On # remove html extension RewriteRule ^/en.html$ /en [R=301,L] RewriteRule ^/en/(.+).html$ /en/$1 [R=301,L] # redirect / to /en RewriteRule ^/$ /en [R=301,L] # spa root rewrite RewriteRule ^/en$ /content/spa-site/en.html [PT,L] # content rewrite RewriteRule ^/en/(.+)$ /content/spa-site/en/$1.html [PT,L]

 

Ronnie09Author
Level 6
May 29, 2023

Hi @lukasz-m 

 

I did that URL is shortening but the page is coming blank

 

iamnjain
Community Advisor
Community Advisor
November 8, 2023

Hi @ronnie09 

is this issue resolved? if yes, can you please mention the steps you did to get it working?

 

Thanks.