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 {
if { [HTTP::host] equals "www1.company.com"} {
HTTP::header replace "Host" "www.company.com"
switch -glob [HTTP::uri]
}
- hoolio
Cirrostratus
Do you actually want to rewrite the Host header or send a 302 redirect back to the client with the updated URL?when HTTP_REQUEST { if { [HTTP::host] equals "www1.company.com"} { HTTP::redirect http://www.company.com[HTTP::uri] } }
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