Skip to main content
Level 2
Aug 28, 2024 11:13 AM UTC
Solved

Removing .html extension from the URL

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. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
EstebanBustamante
EstebanBustamanteAccepted solution
Adobe Champion and Community Advisor
Aug 28, 2024 12:21 PM UTC

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-be-served-on-dispatcher/td-p/436026 

 

Hope this help

Esteban Bustamante

4 replies

SudipSinhaAEM
Aug 28, 2024 11:40 AM UTC

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.

Translate
arunpatidar
Community Advisor
Community Advisor
Aug 28, 2024 12:08 PM UTC
EstebanBustamante
Adobe Champion and Community Advisor
EstebanBustamanteAdobe Champion and Community AdvisorAccepted solution
Adobe Champion and Community Advisor
Aug 28, 2024 12:21 PM UTC

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-be-served-on-dispatcher/td-p/436026 

 

Hope this help

Translate
Esteban Bustamante
AMANATH_ULLAH
Community Advisor
Community Advisor
Aug 28, 2024 3:47 PM UTC
Amanath Ullah