Forum Discussion
How to append to URI
We have parts of our webite that are french, and when a user has access a http://francais.mcgill.ca, I need to append a /fr to certain sites.
I have created this irule but can not get it to work properly.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "francais.mcgill.ca" \
and [string tolower [HTTP::uri]] equals "science"} {
HTTP::uri "[HTTP:uri]/science/fr"
}
}
I have seen similar post regarding appending URI and based the rule off them but the 4th line is not accepted.
Thanks
Chung
- Peter_72728
Nimbostratus
The first issue I see is the test... - Chris_Miller
Altostratus
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "francais.mcgill.ca" } { if { [string tolower [HTTP::uri]] starts_with "/science" } { HTTP::uri "/science/fr/[string range [HTTP::uri] 11 end]" } } }
- chungyu_16122
Altostratus
Thanks alot, i will try it out, however, I forsee that I will have multiple sites that require the /fr but not every site. I have used matchclass operator to send traffic to different servers based off class list, could I do something similar? where I have a list of sites that need to have the /fr appended? - The_Bhattman
Nimbostratus
Hi Chungu,
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