views:

266

answers:

3

When setting up a SharePoint farm, is it technically possible to use the following URL structure?

http://myfarm/webapp1 http://myfarm/webapp2 http://myfarm/webapp3 etc.

where each URL points to a different web application on the same farm/server.

+2  A: 

MDRoz,

Generally speaking, the answer (in a vacuum) is "no." As far as SharePoint is concerned (or rather, IIS), a hostname without any qualifying port information can be mapped to one IIS website.

Now that I've said that: there are variety of creative ways you might address this, and most are going to involve URL re-writing and remapping. A couple of ideas that come to mind:

  1. A wonderful URL rewrite module can be obtained for IIS 7 that might work for you as-is (http://www.iis.net/extensions) ... assuming you're on Windows Server 2008, of course.

  2. You could probably leverage Microsoft ISA Server 2006 to map incoming requests to different SharePoint web applications (IIS websites) based on path information. I don't have an ISA admin console open in front of me right now to explicitly confirm that, though.

  3. You could develop an HttpModule that rewrites incoming URLs so that they are redirected or handled by different sites/web apps. This would ensure that redirection logic is specifically what you want.

Another link that might have some helpful tidbits comes from Todd Klindt, SharePoint MVP and all-around nice guy: http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=48.

Regardless of the route you choose, I'll point out one potential sidenote and watchout: hierarchy and path depth. Generally speaking, any rewriting you do shouldn't alter a page's depth. For example, this would be okay:

myfarm/webapp1/testpage.aspx => app1.myfarm/webapp1/testpage.aspx

... but avoid doing something like this:

myfarm/webapp1/testpage.aspx => app1.myfarm/webapp1/newsite/testpage.aspx

These are fabricated examples, but I hope the point I'm trying to make is clear. In the first example, testpage.aspx is "2 levels" deep from the hostname -- and it stays that way on re-write/redirect. In the second example, it goes from 2 levels deep to 3 levels deep. Depth changes like this can lead to all sorts of insidious little problems during normal operations, as SharePoint depends on the path depth and ordering for some operations and determinations.

I hope this helps!

Sean McDonough
A: 

Can I ask why you would want to do this? You can separate out content databases this way for instance.. no need to create separate webapps.

ArjanP
We're setting up separate a SharePoint farm with web applications for each Business Unit. The "Power That Be" instated on having one host header for all web apps. Although it's obviously not technically feasible, we had to exhaust all options to prove that.
MDRoz
A: 

I agree with Sean and Arjan. Sean is right to point out IIS does not support this and Arjan is right in saying that if you ahve the need for more web apps then actually create them as such, if it is just for URL sake create 1 webapp with multiple site collections each using their own content db.

Colin