Forum Discussion
How to redirect url with extension?
Hi Team,
Could someone tell me what would be the iRule for url with extension to another url with extension.
Eg:
http://xxx.myhost.com/search?profile=NAP
to
http://xxx.myhost.com/search?profile=LL
Similarly,
http://yyy.corp.myhost.com/serach?profile=NAP
to
http://xxx.myhost.com/search?profile=LL
These are the two request. the first one is from one extension to other extension keeping the host as same (from NAP to LL). The second one is from a complete different host to another complete different host with different extension.
Please need help and appreciate help in advance!
2 Replies
- Stewart
Altostratus
Hi Krishna,
This might work for you.
when HTTP_REQUEST { set http_host [string tolower [HTTP::host]] set uri [HTTP::uri] if { (($http_host equals "xxx.myhost.com") and ($uri equals "/search?profile=NAP")) }{ HTTP::redirect "http://xxx.myhost.com/search?profile=LL" return } elseif { (($http_host equals "yyy.myhost.com") and ($uri equals "/search?profile=NAP"))}{ HTTP::redirect "http://xxx.myhost.com/search?profile=LL" return } } - Krishna_R
Nimbostratus
Hi Stewart,
Thank you so much for the iRule. I have wrote another one and it worked as expected. Appreciate your help in advance!
Regards, Krishna
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
