Fluidetom_12222
Dec 19, 2016Cirrus
What's the best approach for an http:redirect with exceptions?
Hey guys,
We're going to move a SharePoint site and all its subsites to a new location in our SharePoint farm. I need to create new iRule to redirect all users to the new site except for one particular subiste. I have written the following iRule but I 'm not sure whether this is the most efficient way to proceed. Would you mind having a look and let me know if there's a better way to handle this?
TIA
Let's say I want ot redirect all requests for https://intranet.company.com/my_old_site to https://intranet.company.com/my_new_site except when it's a request for https://intranet.company.com/my_old_site/subsite_we_need_to_keep?
when HTTP_REQUEST {
Check if path starts with /my_old_site/
if {
[string tolower [HTTP::path]] starts_with "/my_old_site" &&
[string tolower [HTTP::path]] not (starts_with "/my_old_site/subsite_we_need_to_keep")} then {
Modify HTTP::path to replace original request
HTTP::redirect [string map {/my_old_site /my_new_site} [HTTP::path]]
}
}