Not too long ago I received an urgent call from a colleague who changed the URL of her SharePoint sub-site(web) and could no longer access it. For those of you wondering how to do this; go to “site settings” and click on the “Title, Description and Icon” link; you can update the last part of the address in the Web Part Address section (you can only do this for sites, not site collections.)
It just so happens that this was a sub-site of the root, and the URL was changed to “sites”. As most of you know “sites” is automatically reserved by SharePoint for Site Collections. It is a Managed Path of type “Wildcard Inclusion”. Changing the Managed Path type to “Explicit Inclusion” will allow you to access the site, to quickly change the URL. Warning: Any Site Collections located in the Sites path will not be accessible while you are making this change. You’ll want to change it back as quickly as you can.
This is not something I would expect to happen often, I didnt think I’d hear of it again. But sure enough, a couple of weeks later I received a similar cry for help. This time a user updated the address to include “.aspx”. Dont ask me why, I didn’t bother asking. Well, this was a little more complicated (and shame on Microsoft for allowing the user to do such a thing) Now the only way to fix this (that I can think of) is via the API; luckily it doesnt mean we have to write a single line of code. While a Q-Tip and a hair pin wont help us out of this one, I have something else in my McGyver bag of tricks; SharePoint Manager to the rescue. This is an awesome tool created by Carsten Keutman, you may be familiar with one of his other tools WSPBuilder.
SharePoint Manager 2007 is a desktop application that you can run on a SharePoint Server to expose and in many cases update data of the SharePoint object model directly via the API (It gives you plenty of rope to hang yourself if you dont know what you are doing.) To fix the problem described here; run SharePoint Manager 2007, find your way to the site(web) that needs updating and select it, scroll down the properties window until you find the “ServerRelativeUrl” and change its value to something proper.
Remember to save your changes, and look, but dont touch anything else (at least not on the production server.)