Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
sravs
sravsAccepted solution
Community Advisor
April 29, 2024

Hi @kanthsri , you can use resource resolver to map the URLs without html extension.

 

refer https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/deploying/resource-mapping

 

Or if you want to remove the .html extension for particular component you can use the snippet like below in your component html.

 

${'path/page.html' @ extension}
<!-- outputs: path/page -->

 

4 replies

sravs
Community Advisor
sravsCommunity AdvisorAccepted solution
Community Advisor
April 29, 2024

Hi @kanthsri , you can use resource resolver to map the URLs without html extension.

 

refer https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/deploying/resource-mapping

 

Or if you want to remove the .html extension for particular component you can use the snippet like below in your component html.

 

${'path/page.html' @ extension}
<!-- outputs: path/page -->

 

Translate
Jagadeesh_Prakash
Community Advisor
Community Advisor
April 29, 2024

@kanthsri  hope you are looking for a dispatcher rule to remove .html from the url. Try below code

 

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)\.html$ /$1 [NC,L]

 

 

Translate
aanchal-sikka
Community Advisor
Community Advisor
April 29, 2024

@kanthsri 

 

Please have a look at the discussion on https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/after-sling-mappings-config-to-remove-html-redirection-301-of/m-p/393027

 

Prefer using Sling mappings to remove .html extensions/URL shortening from HTML content

Translate
Aanchal Sikka
Harwinder-singh
Community Advisor
Community Advisor
April 29, 2024

@kanthsri  You can strip off .html at the dispatcher level.

Translate