Forum Discussion
jba3126
Aug 08, 2011Cirrus
Select Pool Based on URI with Host Rewrite
Hi All, In short we are going from SharePoint 2007 to 2010. To ease the pain of migrating sites I suggested we use the F5 LTMs to redirect based on the URI. I attempted this with a http class until I discovered that SharePoint checks the host name in the HTTP header. I've been told we might have as many as 30 URIs/Paths to redirect to the old 2007 instance and will need to remove them from the list so to speak as they migrate to 2010. I've done my very best to try to piece together a script that will do the trick and unfortunately I'm falling short :(
Summary:
http://www.abc.com
/uri1
/uri2
/uri3
/uri4
etc. needs to go to sharepoint2007pool and change host from www.abc.com to www.xyz.com. Everything else needs to go to sharepoint2010pool with no host change.
Here is my attempt to accomplish:
when HTTP_REQUEST {
switch -glob [HTTP::path]
if { [HTTP::path]] "/sites/dts*" } {
Rewrite host header value and select pool
HTTP::header replace Host www.xyz.com
pool sharepoing2007pool
}
else {
pool sharepoint2010pool
}
}
***For ease of adding and removing multiple sites, I'm very interested in how I might use the datagroups. That would make it much easier for me to add and remove sites as needed.***
- hooleylistCirrostratusHi Jeff,
- jba3126CirrusAll of the request will come in as www.abc.com but with different URI; however when the request is passed to the web server it will need to be different based on which sharepoint instance it goes to. Apparently sharepoint looks at the host header. The sharepoint team is going to provide us with a list of URI that will need to go to the old sharepoint. Everything else can just go straight to the new sharepoint pool. In reading other posts I'm wondering if I should try to create a datagroup/class. Anything that matches the class would get sent to the old pool and the host would be changed and everything else would be sent to the new pool and the host header left in tact.
- Colin_Walker_12Historic F5 AccountIt sounds like the class approach would be solid. If you have a set list of URIs that need to be redirected, that would be the easiest way to do it, and also the most manageable long term.
- Kevin_Davies_40Nacreous
when HTTP_REQUEST { if { [string tolower [HTTP::path]] starts_with "/sites/dts" } { Rewrite host header value and select pool HTTP::header replace Host www.xyz.com pool sharepoing2007pool } else { pool sharepoint2010pool } }
- jba3126CirrusThat is a great question. I would like this to be as transparent as possible to the end user. In other words I want the users typing www.abc.com from here on out. If the site did a full redirect, I'd be a afraid I'd start having users bookmark the old www.xyz.com site.
- jba3126Cirrus
Thank you for the correction. I will test this out in my lab. Since I will have a list of URIs (30 or so in all) what will be the best way for me add the next URI to this list? Example the next site for testing is /sites/opunix
- Colin_Walker_12Historic F5 AccountTo add more items to the data group you can edit it via the GUI, via the CLI, or via iControl, it really just depends on your preference. In most cases people use the GUI or CLI to manage small-ish data groups.
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