Forum Discussion
Irule Suggestion
Irule Suggestion : dividing the URL based on the Country-Users and based on the official Language page:
-
Currently for every country, they have a separate extension alongwith the official Language page, but seems like http://outlet.XYZ.com/SEUILibrary/controller/e/ seems to be common.
-
We are having a common Virtual-server for the same in the BIGIP, lets say : 10.1.1.1 which is again mapped with a pool named as : Test-Pool having 4 active-servers where currently pages are hosted.
-
Example of the URL Pages based on country : US, IE, UK , DE , FR:
US:
http://outlet.XYZ.com/SEUILibrary/controller/e/outlet_us/XYZPortal/en_US/special-offers.workflow:ShowPromo?LandingPage=/All/US/Portals/Outlet
IE:
http://outlet.XYZ.com/SEUILibrary/controller/e/outlet_ie/XYZPortal/en_IE/special-offers.workflow:ShowPromo?LandingPage=/All/EMEA/Portals/Outlet
UK:
http://outlet.XYZ.com/SEUILibrary/controller/e/outlet_gb/XYZPortal/en_GB/special-offers.workflow:ShowPromo?LandingPage=/All/EMEA/Portals/Outlet
DE:
http://outlet.XYZ.com/SEUILibrary/controller/e/outlet_de/XYZPortal/de_DE/special-offers.workflow:ShowPromo?LandingPage=/All/EMEA/Portals/Outlet
FR:
http://outlet.XYZ.com/SEUILibrary/controller/e/outlet_fr/XYZPortal/fr_FR/special-offers.workflow:ShowPromo?LandingPage=/All/EMEA/Portals/Outlet
Suggestion required:
Incase we can make some irule which will make use of Class-Maps( Data-Group) too to fulfil this, like : all these pages are behind same VIP:
a) If customer browse US site, it will redirect to US Page.
b) If customer browse UK site, it will redirect to UK Page.
c) If customer browse DE site, it will redirect to DE Page.
d) If customer browse FR site, it will redirect to FR Page.
e) If customer browse IE site, it will redirect to IE Page.
Thanks and Regards Parveez
13 Replies
- Parveez_70209
Nimbostratus
Ok,Thank you.
I am so sorry again I am asking the same: I failed to understand the below with value 1 and 3, can you please assist in letting us know taking the same URL example into the aboveL
set hostname [getfield [HTTP::host] ":" 1] set subhostname [getfield $hostname "." 3]
And for Data-Group: dg_name and dg222_name., do we need to need to use String Data-group.
Thanks and Regards Parveez
- What_Lies_Bene1
Cirrostratus
No problem, so with the first getfield command, the delimiter is ':' and thus, if a request like this came in: 'outlet.XYZ.com:80', that command would break it into two fields: 'outlet.XYZ.com' and '80'. We only want the first part so the rule doesn't get confused by the ':80' in the hostname later on. Hence we use 1 to tell the command we only want field 1, the outlet.XYZ.com one.
This of course shows I got the next use of the getfield command wrong. It should be: '[getfield $hostname "." 2]'. This splits outlet.de.XYZ.com into four parts, delimited by '.'. Those parts will be 'outlet', 'de', 'XYZ' and 'com'. The 2 (incorrectly stated as 3 above) stores field two in the variable, field two being 'de'.
Obviously with just outlet.XYZ.com this won't work, hence I've redirect to the US page if the variable doesn't match anything in the first data group.
Yes, a string type data group, the key will be en, the value en_GB etc.
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