Forum Discussion
Hudson_Donovan_
Nimbostratus
Jun 28, 2006Redirection based on URI - should be simple
Hi there,
This is my first post and I am a new user to Big-IP and the rules.
I have a task of creating a redirection rule that passes the URI to a different host domain.
I have written code that somehow doesnt seem to work and was wondering if people could advise me where I have gone wrong.
the senario is this..
if the url is www.ourdomain.com.au we just want the page to load as www.ourdomain.com
however if the url is www.ourdomain.com.au/12345 then we need to redirect to
www.differentcompanydomain.com/12345
where 12345 is a uri that changes all the time.
ive managed to get the first part working.. but the second part wont. can anyone assist.
----------------------------------------------
if (http_uri matches_regex "/") {
redirect to "http://www.ourdomain.com"
}
else {
redirect "http://www.differentcompanydomain.com(http_uri)"
}
Thanks in advance.
Hudson
- Deb_Allen_18Historic F5 AccountTry this ("equals" is a more efficient comparison than "matches_regex"):
if (http_uri == "/") { redirect to "http://www.ourdomain.com" } else { redirect to "http://www.differentcompanydomain.com/%u" }
- Hudson_Donovan_
Nimbostratus
Cheers,
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