for example if a user clicks on a document located at "; I need the iRules to redirect it but need it to be based almost like a wildcard /*.
when HTTP_REQUEST {
if { [HTTP::host] equals "old.sharepoint.net" and [HTTP::uri] equals "/sites/migrationtesting/" } {
HTTP::redirect "https://new.sharepoint.com/sites/migrationtesting/"
}
I think I understand your request.
If you are just changing the host that the content is served from, but the URI is the same, this iRule should do what you need:
when HTTP_REQUEST {
set oldSite "old.sharepoint.net"
set newSite "new.sharepoint.com"
set testUri "/sites/migrationtesting/"
if {([HTTP::host] equals $oldSite) and ([HTTP::uri] starts_with $testUri)} {
HTTP::redirect "https://$newSite[HTTP::uri]"
}
}