Forum Discussion
redirect URL iRule
16 Replies
- stan_piron
Cumulonimbus
such a short question...
What do you mean by "redirect"? Most of question with redirect on this forum is forward and not redirect...
If you look some question below, you can find this question with the same need: https://devcentral.f5.com/questions/inefficient-irule-works-but-not-perfect
- stan_piron
Cumulonimbus
did you look the link??? your need is covered by it...
you can also create a LTM policy instead of iRule if you don't know how to manage irules...
Create a policy with require "http" and action "Forward".
Create a rule with
- condition HTTP Host equals anything.com
- action http reply redirect location http://[HTTP::host][HTTP::host]
Apply the policy in VS ressources... and finished...
- stan_piron
Cumulonimbus
can you upload your policy screenshot?
- Ahmad_03_151082
Nimbostratus
- stan_piron
Cumulonimbus
your condition and action are wrong..
- condition : http-host host equals tstwsl.cio.gov.bh
- action : http reply redirect location http://vtstwsl.cio.gov.bh[HTTP::host]
- Ahmad_03_151082
Nimbostratus
- stan_piron
Cumulonimbus
why did you configure http-auth condition???
- Ahmad_03_151082
Nimbostratus
- Ahmad_03_151082
Nimbostratus
I want to add that for http://something.com there are no virtual servers were created i have 2 virtual servers HTTP and HTTPs for http://anything.com
- stan_piron
Cumulonimbus
did you assign this policy on the VS configuration?
what behavior do you have?
- TechT
Nimbostratus
Hi Ahmad, to make it short- remove the policy from VS and apply below irule to VS and try please
when HTTP_REQUEST { if { ([HTTP::host] contains "tstwsl.cio.gov.bh") } { HTTP::redirect "http://vtstwsl.cio.gov.bh[HTTP::uri]" } }
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