Forum Discussion
Dave_73612
Nimbostratus
Jul 01, 2009Multiple 301 redirects and F5 performance
Hi guys,
I have a requirement to do over 40 301 redirects (google ranking purposes) for one of our websites which I was going to implement via IRule attached to the Virtual server for t...
hoolio
Cirrostratus
Jul 03, 2009I assume the application won't redirect the client back to /something/index.htm. How about this then:
when HTTP_REQUEST {
Check if request ends with /index.htm
if {[HTTP::path] ends_with "/index.htm"}{
HTTP::respond 301 Location "[string map {/index.htm ""} [HTTP::uri]]"
log local0. "Redirecting to [string map {/index.htm ""} [HTTP::uri]]"
}
}
Note that RFC2616 states the Location header value must be a fully qualified domain name, but browsers accept a local URI. You may want to hardcode the protocol and domain in the iRule.
Aaron
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