Forum Discussion
inline irule redirect
i'm trying to do a irule redirect from one host header to another. User is moving site content from one site to another. But i want to make it inline so that, any folder/file within that path is redirect too. so anything after BMD, folder or file is redirect to that same path, instead of defaulting to BMD. Thanks for looking.
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "abc.com" and [string tolower [HTTP::uri]] starts_with "/sites/pocc/bm/bmd"} {
HTTP::redirect "https://xyz.com/sites/pocc/bm/BMD/" }
}
5 Replies
- Cory_50405
Noctilucent
Is this iRule not working the way you intend? Your syntax looks good.
- Jeff_Nguyen_449
Nimbostratus
it doesn't fit the desire need. I'm wanting everything under /BMD/ to be redirected. So if a user wants to hit /BMD/folder1/file.abc, it will send him there with the iRule. But in it current state, it send the users to /BMD/default.htm.
- Cory_50405
Noctilucent
I see what you mean. Try this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "abc.com" and [string tolower [HTTP::uri]] starts_with "/sites/pocc/bm/bmd"} { HTTP::redirect "https://xyz.com[HTTP::uri]" } } - Jeff_Nguyen_449
Nimbostratus
that worked. Thanks!
- Cory_50405
Noctilucent
You got it. Happy Friday.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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