Forum Discussion
demmo_251289
Nimbostratus
Dec 22, 2016adding 301 redirect to page extension swap
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" } {...
Vijay_E
Cirrus
Dec 22, 2016Try:
if { [HTTP::path] ends_with ".html" } {
HTTP::uri [string map -nocase {".html" ".htm"} [HTTP::path]]
HTTP::respond 301 Location "http://[HTTP::host][HTTP::uri]"
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects