Forum Discussion
Daniel_S_135288
Mar 18, 2015Nimbostratus
match_regex redirect
Hello Guys
Im need your help
I try to redirect a URI with a dynamic Number
my iRule looks like this at the moment
if { [HTTP::uri] matches_regex {/c/cn[0-9]{5}} } {
H...
Daniel_S_135288
Mar 19, 2015Nimbostratus
hey
finally i did id like that
set lowuri [string tolower [HTTP::uri]]
if { $lowuri matches_regex {/cn[0-9]{5}} } {
set new_uri [regexp -inline {/cn[0-9]{5}} $lowuri]
HTTP::respond 301 Location https://www.aaa.com/c/$new_uri
return
}
if { [HTTP::uri] matches_regex {/cn[0-9]{4}} } {
set new_uri [regexp -inline {/cn[0-9]{4}} $lowuri]
HTTP::respond 301 Location https://www.aaa.com/l/$new_uri
return
}
if { $lowuri matches_regex {an[0-9]{9}} } {
set new_uri [regexp -inline {an[0-9]{9}} $lowuri]
HTTP::respond 301 Location http://www.aaa.com/v/$new_uri
return
}
thanks for your help Michael
BR
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