Forum Discussion
Channafc_199743
Nimbostratus
Nov 14, 2017Is it possible to to do a HTTP redirect via URI and have anything after the / rediect as well?
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/"
}
- Lee_Sutcliffe
Nacreous
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]" } }
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