Forum Discussion
1 Reply
Sort By
- Vijay_ECirrus
Try:
if { [HTTP::path] ends_with ".html" } { HTTP::uri [string map -nocase {".html" ".htm"} [HTTP::path]] HTTP::respond 301 Location "http://[HTTP::host][HTTP::uri]" }
Hello, I've got below snippet to replace .html to .htm. It works fine but i'd like to add a 301 redirect. Could you please help me with that ?
Thank you
if { [HTTP::path] ends_with ".html" } {
HTTP::uri [string map -nocase {".html" ".htm"} [HTTP::path]]
}
Try:
if { [HTTP::path] ends_with ".html" } {
HTTP::uri [string map -nocase {".html" ".htm"} [HTTP::path]]
HTTP::respond 301 Location "http://[HTTP::host][HTTP::uri]"
}