Forum Discussion
krish_net_18726
Nimbostratus
Jun 10, 2015I-rule for URI- redirection
We are planing for URI redirection on STG environment where we want if some one type
https://abc.com/SitePages/Homepage.aspx it should redirect to
https://abc.com/personal-finance/overview
Whic...
nitass_89166
Noctilucent
Jun 10, 2015if some one type https://abc.com/SitePages/Homepage.aspx it should redirect to https://abc.com/personal-finance/overview
you can check uri using HTTP::uri and redirect using HTTP::redirect command.
HTTP::uri
https://devcentral.f5.com/wiki/iRules.HTTP__uri.ashx
HTTP::redirect
https://devcentral.f5.com/wiki/iRules.HTTP__redirect.ashx
- krish_net_18726Jun 10, 2015
Nimbostratus
Thanks for your reply, But how come pool will serve the request when both pages are served by same server. - nitass_89166Jun 10, 2015
Noctilucent
sorry, what do you mean? - krish_net_18726Jun 10, 2015
Nimbostratus
In this request my both URL are pointing to the same server than how the cgi_Pool will come in picture when HTTP_REQUEST { 2 if { [HTTP::uri] ends_with "cgi" } { 3 pool cgi_pool 4 } elseif { [HTTP::uri] starts_with "/abc" } { 5 pool abc_servers 6 } 7 } - nitass_89166Jun 10, 2015
Noctilucent
are you talking about redirection of https://abc.com/SitePages/Homepage.aspx or something else? /SitePages/Homepage.aspx does not end with cgi or start with /abc, does it? - krish_net_18726Jun 10, 2015
Nimbostratus
I just want to know that which I-rule I should apply so that I can get the desired URL. as mentioned earlier... - nitass_89166Jun 10, 2015
Noctilucent
e.g. configuration [root@ve11b:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when HTTP_REQUEST { if { [HTTP::uri] equals "/SitePages/Homepage.aspx" } { HTTP::redirect "https://[HTTP::host]/personal-finance/overview" } } } test [root@ve11b:Active:In Sync] config curl -Ik https://172.28.24.10/SitePages/Homepage.aspx -H "Host: abc.com" HTTP/1.0 302 Found Location: https://abc.com/personal-finance/overview Server: BigIP Connection: Keep-Alive Content-Length: 0
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects