Forum Discussion
MQKC_254171
Nimbostratus
Mar 13, 2016How do I do a 301 redirect to an exact URI only?
I have seen other example irules for redirection that have an undesired behavior.
What I want is for abc.com, abc.com/home, abc.com/careers.html, etc. to all be redirected to def.com/locations. ...
Vernon_97235
Mar 13, 2016Historic F5 Account
If I understand your requirements, you want all requests to abc.com to be redirected to a single alternative URL regardless of the request-uri fragment supplied for the original request. That is, http://abc.com/place/any/path/here?and=any&query=parameters would be redirected to the exact URL http://def.com/locations. If so:
when HTTP_REQUEST {
HTTP::respond 301 Location "http://def.com/locations"
}
MQKC_254171
Nimbostratus
Mar 14, 2016Thanks. That worked perfectly. It looks like I just needed to remove the "[HTTP::uri]" from the end of the response command.
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