Forum Discussion
Joe_Frost_43072
Nimbostratus
May 11, 2007Redirect based on images to another domain
I'm trying to redirect based on path/uri content to another domain while keeping intact the structure of the request if the uri content is not mached just send to a local pool.
Similair to apache:
RedirectMatch ^/(.*)$ http://www.domain.com/$1
Here is what i have so far:
class apache {
".au"
".cab"
".exe"
".flv"
".gif"
".jar"
".jpg"
".png"
".zip"
"/images/"
}rule live_statics_rule {
when HTTP_REQUEST {
if { [ matchclass [HTTP::path] contains $::apache ] } {
HTTP::redirect "http://img.domain.com"
}
else {
pool live_resin
}
}
}Will this work or do i need more logic to preserve the full uri request on the client side?
1 Reply
- hoolio
Cirrostratus
You would want to include the original URI in the redirect.rule live_statics_rule { when HTTP_REQUEST { if { [matchclass [HTTP::path] contains $::apache] } { HTTP::redirect "http://img.domain.com[HTTP::path]" } else { pool live_resin } } }
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