Forum Discussion
Help with a redirect with a uri modification.
I am having an issue where I need to redirect a particular site on SharePoint to a different server farm.
I would like to see and anything that comes after the apr redirected to and include the anything after the apr from above
so if I go to he would get redirected to
but if sally came along and went to she would get redirected to
I have this already and it kinda works
when HTTP_REQUEST {
if { [HTTP::uri] contains "/apr" } {
HTTP::redirect "https://sharepoint2/sites/apr"
}
}
The problem is everything gets redirected to /sites/apr and doesn't include /chris or /sally. I know that is what my irule says to do but how would I include whatever is in the rest of the string after /apr and change the /techservices/govern to sites?
Thanks in advance for any help.
1 Reply
Hi Chris,
you may try the snippet below. It uses the
syntax, to cut the first 20 characters from the requested[string range]
to build the redirect location...[HTTP::uri]when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/techservices/govern/apr" } then { HTTP::redirect "https://sharepoint2/sites[string range [HTTP::uri] 20 end]" } }Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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