Forum Discussion
Angelo_102265
Nimbostratus
Jul 22, 2009Http Rewrite to 1 domain
I need to create an irule that is listening on 1 VIP and changes all incoming requests to a single domain to the server pool.
www.cname1.com/images -> F5 VIP -> www.static.com/images ->...
hoolio
Cirrostratus
Jul 22, 2009Using HTTP::redirect will send a 302 redirect back to the client with the Location in the redirect set to whatever you put in quotes. If you want to rewrite the Host header, you can use HTTP::header replace Host "newhost.example.com":
when HTTP_REQUEST {
Rewrite host header
HTTP::header replace Host "www.static.com"
Rewrite URI?
if {not ([HTTP::uri] starts_with "/images")}{
Prepend /images to the URI
HTTP::uri "/images[HTTP::uri]"
}
}
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