Forum Discussion
Rob_Notaro_7816
Nimbostratus
Nov 08, 2007Simple URL redirect
I just want a request from www1.company.com to redirect to www.company.com. I dont want to change anything that might be after the url.
Will this do the trick?
when HTTP_REQUEST {...
hoolio
Cirrostratus
Nov 09, 2007Do you actually want to rewrite the Host header or send a 302 redirect back to the client with the updated URL?
If you remove the switch command from your rule, you would successfully replace the Host header in the request sent to the web servers with the updated host value.
If you wanted to redirect clients to the new host with the same URI, you can use this:
when HTTP_REQUEST {
if { [HTTP::host] equals "www1.company.com"} {
HTTP::redirect http://www.company.com[HTTP::uri]
}
}
Note that you should change http:// to https:// in the redirect if your VIP is using client SSL.
Aaron
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