Hello
I want to an iRule to redirect
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: DevCentral - An F5 Technical Community
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
Apply the policy in VS ressources… and finished…
can you upload your policy screenshot?
your condition and action are wrong..
why did you configure http-auth condition???
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
did you assign this policy on the VS configuration?
what behavior do you have?
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]" }
}
This is the iRule solution which do the same as my policy… except…
When a question is like this one, I think the policies are easier than irules to understand and configure…
Most of my deployments use both irules and policies:
The main goal of this is when changing irules, there is a risk of TCL error if something is wrong… so when there is a new need for a specific URL, the administrator can modify the policy easily and safer.
Ahmad,
The provided irule and policy may work.
I think the issue is these configuration are not applied to the VS. can you upload your VS configuration?
to get configuration of a virtual server, connect to SSH and execute :
tmsh list ltm virtual
change your IP information and upload it.
Any Update ?
Any Update ?
Thank you for your help the issue has been solved it was network issue…
thank you again