Forum Discussion
Irule uri redirect using regex?
Hi,
I need to do something like the following;
redirect /any/any/home/any to some.site.com
Where the uri's could be one of many pages using same pattern...
is there an easy way to do this using regex or something?
thx!
- Richard__HarlanHistoric F5 Account
You could try contains "/home/". This should match on anything that contains the /home/ anyplace in the uri.
- Philippe_CLOUPEmployee
Hi JPV, with HTTP Classes, you can write something like that. From GUI, you can put //home/* in the "URI Paths" section of the HTTP Class, and select "Actions" redirect to, then put your URI in the "redirect to" section. You can also use Regex format for that in HTTP Classes, if you don't need "*" notation (regex instead of pattern).
But this is valid with version 11.3 or before.
in 11.4, LTM Policies (CPM) will not help because they don't support yet the regex notation. So you will then have to move into pure iRules with the regex command.
- JPV_131616Cirrus
bsically I have a set of pages which contains languages, which is why i wanted a regex or something easy.
I am on version 10.2 for this f5 pair.
thx
- Philippe_CLOUPEmployee
okay, so in that case, and with version 10.2, i would go for HTTP Class, for better manageability and performance, than pure iRule.
Anything i can help here ? Do you have a set of text with the regex/pattern you are trying to work with ?
- JPV_131616Cirrus
Here is an example;
http://some.site.com/en/ON/plans/index.shtml http://some.site.com/fr/ON/phones/index.shtml http://some.site.com/en/AB/plans/index.shtml http://some.site.com/fr/AB/phones/index.shtml http://some.site.com/en/BC/plans/index.shtml http://some.site.com/fr/BC/phones/index.shtml http://some.site.com/en/MB/plans/index.shtml http://some.site.com/fr/MB/phones/index.shtml http://some.site.com/en/NB/plans/index.shtml http://some.site.com/fr/NB/phones/index.shtml http://some.site.com/en/NL/plans/index.shtml http://some.site.com/fr/NL/phones/index.shtml http://some.site.com/en/NS/plans/index.shtml http://some.site.com/fr/NS/phones/index.shtml http://some.site.com/en/SK/plans/index.shtml http://some.site.com/fr/SK/phones/index.shtml http://some.site.com/en/PE/plans/index.shtml http://some.site.com/fr/PE/phones/index.shtml http://some.site.com/en/QC/plans/index.shtml http://some.site.com/fr/QC/phones/index.shtml
basically it's language and provide variations.
- JPV_131616Cirrus
not sure why the links are doubled...
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