Forum Discussion
irule to redirect http URL to a server URL
Hi Guys,
Hope you may be able to help,
I have the following scenario.
I have a DNS entry test.acb.xyz/TE and this maps to an LTM Vip with a Load balanced server behind it.
however the webpage is not hosted on the default place and the request needs to be sent on to to get to the correct page.
I understand that i need an irule to do this but wanted to make sure i am going to configure the correct type. Below is what i have worked out from another previous irule that stream rewrites. I am not sure if this is what i want or not.
when HTTP_REQUEST priority 100 { set pre_filter_substr "XYZ.net" set after_filter_substr "XYZ.com"
Enable the stream filter for text responses only if {[HTTP::header value Content-Type] contains "text"} { create a STREAM expression to replace
STREAM::expression {@HTTP://test.abc.xyz;/TE@http://Server1;8080;/ABC2
STREAM::enable;
}
when HTTP_RESPONSE priority 100 { set pre_filter_substr "XYZ.net" set after_filter_substr "XYZ.com"
Enable the stream filter for text responses only if {[HTTP::header value Content-Type] contains "text"} { create a STREAM expression to replace
STREAM::expression {@http://Server1;8080;/ABC2@HTTP://test.abc.xyz;/TE enable STREAM STREAM::enable
} }
I am very new to iRules so any info would be greatly appreciated.
Thanks
Neil
When using a recent version of the BIG-IP software, you can use the LTM rewrite-uri-translation profile instead of an iRule. For an example, see the second answer in this post:
https://devcentral.f5.com/questions/v12-url-uri-rewrite-51243
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