07-Nov-2023 07:57
Hello,
I'm very new to the F5 platform and creating iRules. I did try searching the forums, and there is a lot of good information (thank you contributors), but can't find a solution to exactly what I need to do.
We are migrating off an on-premise Sharepoint to Sharepoint Online/365. I would like to have an iRule that states:
If you are going to myportal.company.com then redirect to sharepointonline.company.com but if there is anything after the URI then redirect to sharepointonline.company.com/sites/<URI>
For example:
myportal.company.com = sharepointonline.company.com
myportal.company.com/hr = sharepointonline.company.com/sites/hr
myportal.company.com/aa = sharepointonline.company.com/sites/aa
I was hoping not to have to list out every URI, but I didn't know if I could use a wildcard. Any help or pointers would be appreciated
Solved! Go to Solution.
07-Nov-2023 08:31
Hi joeinbuffalo,
when HTTP_REQUEST {
if { [HTTP::host] eq "myportal.company.com" } {
if { [HTTP::uri] eq "/" } {
HTTP::redirect "https://sharepointonline.company.com"
return
}
else {
HTTP::redirect "https://sharepointonline.company.com/sites[HTTP::uri]"
return
}
}
}
07-Nov-2023 08:31
Hi joeinbuffalo,
when HTTP_REQUEST {
if { [HTTP::host] eq "myportal.company.com" } {
if { [HTTP::uri] eq "/" } {
HTTP::redirect "https://sharepointonline.company.com"
return
}
else {
HTTP::redirect "https://sharepointonline.company.com/sites[HTTP::uri]"
return
}
}
}
07-Nov-2023 10:58
Hello @Enes_Afsin_Al,
This worked perfectly! I truly appreciate your time and expertise in assisting me.
Thank you!
Joe
08-Nov-2023 13:56
Right out of the gate you got the word direct from one of our MVPs! Great well-formed question. Quick easy answer.
Nice.
Thanks @Enes_Afsin_Al
Welcome to the DevCentral community @joeinbuffalo!