Forum Discussion
Dennis_Jalbert
Sep 24, 2011Nimbostratus
Complex Redirect
I’m trying to create a redirect which changes the FQDN, keeps part of the URL static, and preserves the remaining part of the URI. That static part is going to be different on each side of the redirect though. Here is an example:
hosta.site.com/blah1/blah2/blah3/*
should redirect to
hostb.site.com/something1/something2/something3/*
where * could be anything that needs to be copied over.
It seems like I need to assign the wildcard part to a variable and then just use that in the redirect statement, but I’m not sure how to do that. I haven't done anything this complex before and I wasn't able to find anything like this by searching for forums. Thanks in advance!
- The_BhattmanNimbostratusHi Dennis,
- Patrick_Chang_7Historic F5 AccountThe split command will allow you to separate the URI into sections (based upon the separator - "/" seems the most logical one to use here).
- HamishCirrocumulusComing from a perl perspective, I'd probably use a regex myself... But timings may force another approach. Long uri strings with many /'s in them may make using split unweildy.
- Dennis_JalbertNimbostratusHey guys,
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