Forum Discussion
tfs128
Nimbostratus
Jun 09, 2020URI rewrite with wildcard
Working on setting up an irule and have been using this post for reference. Request will be coming in as https://site.domain.com/text1/text2/text3/wildcard/text4, where the wildcard can be any ap...
cjunior
Nacreous
Jun 09, 2020Hello,
Is that URI a fixed one with one wildcard piece?
If so, I would do this way:
when HTTP_REQUEST {
# Checks whether the path starts with /text1/text2/text3 and ends with /text4
if { [string match -nocase {/text1/text2/text3/*/text4} [HTTP::path]] } {
# Put /text5/text6/text7, append original URI from 18 char to end (Skip the starts length from /text1/text2/text3)
HTTP::uri "/text5/text6/text7[string range [HTTP::uri] 18 end]"
pool pool1
}
}Regards
tfs128
Nimbostratus
Jun 09, 2020Correct, only the wildcard can vary. It will always come in starting with /text1/text2/text3 which I'll need to change into /text5/text6/text7. The /wildcard/text4 will always end the URI.
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