Forum Discussion
Irule to rewrite URL
- Apr 19, 2017
Sorry I just noticed that you do not want a redirect but a pool assignment The key is you want to remove /sav/dtl/ and /sav/jog to remove these characters use the string range command. pool1 is the first server and pool 2 is the second server. Make sure the pool are using the 8081 port
when HTTP_REQUEST {
set Vuri [ string tolower [HTTP::uri]]
if { $Vuri starts_with "/sav/dtl/"} then { set HTTP::uri to start 8 Characters from the start og it self HTTP::uri [string range [HTTP::uri] 8 end] pool pool1 } elseif {$Vuri starts_with "/sav/jog/" } then { HTTP::uri [string range [HTTP::uri] 8 end] pool srvpool2 }
}
Sorry I just noticed that you do not want a redirect but a pool assignment The key is you want to remove /sav/dtl/ and /sav/jog to remove these characters use the string range command. pool1 is the first server and pool 2 is the second server. Make sure the pool are using the 8081 port
when HTTP_REQUEST {
set Vuri [ string tolower [HTTP::uri]]
if { $Vuri starts_with "/sav/dtl/"} then {
set HTTP::uri to start 8 Characters from the start og it self
HTTP::uri [string range [HTTP::uri] 8 end]
pool pool1
}
elseif {$Vuri starts_with "/sav/jog/" } then {
HTTP::uri [string range [HTTP::uri] 8 end]
pool srvpool2
}
}
- Bimbo_180412Apr 19, 2017Nimbostratus
Thanks for this Hectorm, I will test this tomorrow and revert back. It's the 'string range' command that I might have been looking for.
- Hectorm_262752Apr 19, 2017Cirrus
Yes also notice that the range command starts at 0 and not 1 so I think you may need to change the 8 for a 7 since you want the last bracket not to be removed.
- Bimbo_180412Apr 20, 2017Nimbostratus
Thanks, I will check that in the morning while testing.
- Bimbo_180412Apr 20, 2017Nimbostratus
I have confirmed that this works, thanks for your help on this Hectorm.
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