I had a co-worker recently ask me about some of the incredibly long URL’s now used in SharePoint 2010. In SharePoint 2007, the URL to a document hosted in a document library looked something like http://sharepoint/sites/teamsite/project%20documents/mydoc.xls. Great for cutting and pasting into an e-mail. After upgrading the SharePoint 2007 farm to SharePoint 2010, right-clicking on that same document and copying the URL would result in something that looked like
http://sharepoint/sites/teamsite/_layouts/xlviewer.aspx?id=/sites/teamsite/project%20documents/mydoc.xls&Source=http%3A%2F%2Fsharepoint%2Fsites%2Fteamsite%2Fproject%20documents%2FForms%2FAllItems%2Easpx%3FRootFolder%3D%252Fsharepoint%252Fsites%252Fteamsite%252Fproject%documents%26View%3D%7B391E5EDC%2DAA9C%2D4F64%2D9E8D%2D401965CFC83A%7D&DefaultItemOpen=1
Not so good for cutting and pasting into an e-mail, right? Why did the URL length grow so long when referring to the same document for which SharePoint 2007 had such a nice short URL?
SharePoint 2010 is not the only place with long names. Picture by Bree Bailey
PowerPoint in the browser, courtesy of Office Web Apps
What if you just want to link directly to the document itself? Some e-mail programs limit the length of URLs, as do places within SharePoint itself (Document Link content types can only be 260 characters, and links within “Current Navigation” are also limited). The link to the open-in-web-apps-view is usually too long.
Let’s deconstruct the long url:
Pretty sure your eyes are crossed at this point… this is way more than you wanted to know. Anyhoo… the point I was trying to make is… out of that ginormous URL, it is relatively easy to extract the path to the document itself. That source parameter is only necessary for Web Apps, and it takes up a lot of spac. Just combine the protocol with the server name with the parameter saying where the document is (in our example above, http://sharepoint/sites/teamsite/project%documents/mydoc.xls. It’s easier done than said
The other way to change the behavior away from long URLs (and back to the way SharePoint 2007 worked) is to change the default document opening behavior. You must be a Site Collection Administrator to do so, and simply go to:
Now you will notice that right-clicking on a document and selecting the URL will leave you with a nice short URL. Hope this helps someone!