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
3 Likes

Thank you very much!

1 Like

Hi @rafael10, your topic has a solution here.

Let us know what you think of the solution by logging in and give it a :+1: or :-1:.


Solutions help the person that asked the question and anyone else that sees the answer later. Login to tell us what you think of the solution with a :+1: or :-1:.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.