Forum Discussion
IRULE HTTP Redirection
Hi Team,
I need to configure URI redirection as below . Can you Please help me to create IRULE Please
http://abc.com/xxx/* to http://xyz.com/xxx/* . Here * should have same value even after redirection meaning if user connects to http://abc.com/xxx/123 F5 should redirect to http://xyz.com/xxx/123 . Also Client browser should display original URL (http://abc.com/xxx/*) not the redirected URL.
Your assistance will be highly appreciated .
Thanks, Senthil
7 Replies
- Eugene_Reznik_1
Nimbostratus
Senthil, can you provide a little more info on your setup? Are abc.com and xyz.com both VIPs on your F5? Are you redirecting all the requests or just a specific path?
- senthil147_1421
Nimbostratus
Thanks for your reply Eugene.
xyz.com is external link its not VIP in our F5. Redirection required for all the requests to this URL http://abc.com/xxx/* . So anything comes after xxx/* should be redirected. i have given below examples
Example 1:
http://abc.com/xxx/community/ http://xyz.com/xxx/community/
Example 2:
http://abc.com/xxx/test/ http://xyz.com/xxx/test/
Thanks, Senthil
- Brad_Parker
Cirrus
You are looking for a rewrite, not redirection. Try something like this.
when HTTP_REQUEST { set http_host [string tolower [HTTP::host]] switch $http_host { "abc.com" { HTTP::host xyz.com return } - senthil147_1421
Nimbostratus
Hi bepsoccer,
Thanks your reply. I do not want to match only domain abc.com. rewrite or redirection has to be done for abc.com/xxx not for main domain abc.com.
Can you Please help me ?
Thanks, Senthil
- Eugene_Reznik_1
Nimbostratus
Try something like this.
when HTTP_REQUEST { set http_host [string tolower [HTTP::host]] if { [string tolower [HTTP::host]] equals "abc.com" }{ switch -glob $uri { "xxx" { HTTP::host xyz.com return } } } - senthil147_1421
Nimbostratus
HI,
I tried creating this IRULE but getting Error.Attached the screenshot.
Thanks, Senthil
- lkchen
Nimbostratus
How about something like this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "abc.com" }{ switch -glob [HTTP::uri] { "/xxx" - "/xxx/*" { HTTP::host xyz.com return } } } }
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