Redirectiong links with .html extension on old URL´s

How can I implement a redirect rule that applies to all links with the .html extension by removing it? Example: https://domainname.com/.../article.html → redirect to https://domainname.com/.../article

Hi,

You can create a Redirect Rule with the http.request.uri.path.extension field to match html and the substring() function to remove the last 5 characters from the path.

When incoming requests match...
lower(http.request.uri.path.extension) eq "html"

URL Redirect

Type: Dynamic
Expression: 
concat("https://www.example.com", substring(http.request.uri.path, 0,-5))
Preserve Query String: Yes
2 Likes