Skip to main content
Level 2
March 30, 2020
Solved

Mapping package for redirection to another internal page for removal of .html

  • March 30, 2020
  • 1 reply
  • 2137 views

Hi Guys,

 

We have a requirement to remove all .html extensions in website for best SEO practices, we have removed all .html with help of dispatcher rules and corresponding mapping.

 

But we have an issue with redirect pages which adding .html by default.

For e.g.  https://mywebsite.com/redirectPage/ (redirect page to home)

is redirect to https://mywebsite.com/home.html 

 

We have tried mapping package for internal redirection but havent worked. Please find below mapping package rules.

 

sling:match = ".+/home.html"

sling:redirect = "/home/"

 

But it is not working as expected (going to blank package even though we have correct internalmapping for /home/)

please let us know if i have done anything wrong above or give me a way to rectify this issue.(Note: let me know if we can do it without help of dispatcher rules)

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 joerghoh

Have you tried to change the default extension in AEM?

 

http://localhost:4502/system/console/configMgr/org.apache.sling.servlets.resolver.SlingServletResolver

1 reply

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
March 30, 2020
Level 2
March 31, 2020
we are facing issue only with redirect pages which is adding .html at end of redirected URL, Can we remove .html for redirected page?