Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

iRule for migrating to Sharepoint Online

joeinbuffalo
Nimbostratus
Nimbostratus

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  

1 ACCEPTED SOLUTION

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
    }
  }
}

View solution in original post

3 REPLIES 3

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
    }
  }
}

Hello @Enes_Afsin_Al

This worked perfectly!  I truly appreciate your time and expertise in assisting me.    

Thank you!

Joe

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!