Forum Discussion
SathishF5Dasam
Nimbostratus
Jun 04, 2016Regex to irule
Hi All,
I'm new to Irule and find difficult to migrate this regex into irule
Regex
RewriteRule ^/company/(.*)(?http://www.test.com/company/$1/en_gb [R=301,L]
My config
"/company/*...
Yann_Desmarest
Cirrus
Jun 04, 2016Here the same irule a bit modified to fit for all webpages you need to rewrite :
For this one, you will need to create a string datagroup first named "rewrite_uri" and add all your starts uri (/auto, /bike, etc.)
when HTTP_REQUEST {
if { [class match [HTTP::path] starts_with rewrite_uri] and !([HTTP::path] contains "en_gb") } {
set uri "http://www.test.com[HTTP::path]/en_gb"
HTTP::respond 301 noserver "Location" "$uri" Cache-Control" "no-cache, must-revalidate"
}
}
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