Forum Discussion
iRule Redirect URL and change client address
Hi,
Im trying to implement an iRule on our corporate BigIP so when the requested URI for domain mydomain.com is /abc - for example http://mydomain.com/abc, I'd like to redirect and rewrite user's client URL to http://mydomain.com/xyz/hi.
Lurking the forums, I couldn't find the right way to do so. Can you suggest?
Thanks!
3 Replies
- Stefan_Klotz
Cumulonimbus
Do you mean something like this?
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/abc" } { HTTP::respond 301 Location "http://[HTTP::host]/xyz/hi" } }Ciao Stefan ๐
- Stefan_Klotz
Cumulonimbus
Do you have a virtual server just for port 80 or also for port 443? And how are the poolmembers configured for each?
And even if your application is doing some redirects as well, the LB and iRule will be triggered before.
Please try this again:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/abc" } { log local0. "redirect triggered" HTTP::respond 301 Location "http://[HTTP::host]/xyz/hi" } }You can also try some browser analyze tools like Fiddler or HTTPWatch to verify if the redirect really doesn't be triggered.
Ciao Stefan ๐
- autogun_200714
Nimbostratus
@Stefan, the iRule works just fine, the problem was between the chair and the keyboard! Thank you so much!
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