Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Removing .html extension from the URL

Avatar

Level 2

Hi all,

I am working on removing the .html extension from the url, Can anyone guide on this in detail, how I can acheive this.

Thanks in advance. 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, 

The approach can vary depending of your requirements, please check this thread were there is a good discussion about the topic with couple approaches: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/extensionless-every-url-to... 

 

Hope this help



Esteban Bustamante

View solution in original post

4 Replies

Avatar

Level 1

If you are using a java file then please do below part:

if (url.contains(".html")) {

url=url.replace(".html" , "");

}

 

This will solve your problem.

Avatar

Correct answer by
Community Advisor

Hi, 

The approach can vary depending of your requirements, please check this thread were there is a good discussion about the topic with couple approaches: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/extensionless-every-url-to... 

 

Hope this help



Esteban Bustamante