Case-Sensitive URL in SharePoint: Lesson Learned

In a recent project, we routinely modify a site, save the site as template and use the solution created to create new sites programmatically. This has been working well for the client for last six months and we haven’t encountered any issues. Occasionally, however, we encountered a problem which prevented us from deactivating or activating the solution in the solutions gallery. To overcome this, we deleted solutions from End User Recycle Bin and Deleted End User Recycle Bin views.

But this time around, every time I created the solution and created a site using this new solution and template, my new site looked bizarre! For instance, one of the libraries didn’t have the All Documents view and defaulted to My Documents view. But if you modified the URL for the library (from MyItems.aspx to AllItems.aspx), it would display the documents. Another difference was that the text from all content editor web parts on list pages were missing. The issue is displayed in pictures below using a test site.

Original site with content editor web part (highlighted by red box)

Site created from template with case-sensitive URL is missing the content editor web part

The site, which was saved as template (named TemplateSite with url TemplateSite) had all of the above: content editor web part content and the All Items view. It looked like the newly-created site took a very old version of the template solution, which didn’t exist anywhere in site collection — including the Recycle Bin. I tried the following steps several times:

1. Deactivate/delete the solution from solution gallery
2. Remove solution from Recycle Bin
3. Go to http://sitecollectionurl/templateSite/_layouts/savetmpl.aspx
4. Enter name of solution and check the “include content” checkbox in template
5. Hit ok
6. New solution gets created
7. Ensure it is activated
8. Now create a new site using the newly-created template

Consistently, the new site was missing some of the content from the original TemplateSite.

On one of these tries, I noticed I was typing “templateSite” with a lowercase t and not an uppercase T.

After I fixed the case in the URL and saved the site again as a template solution, I created a new site based on this solution and woot! This time it worked!

What does this tell you? Yes, SharePoint is case sensitive when you try to save a site as template, and therefore you need to be very careful when typing URLs on your own.

  • Here’s another example of case-sensitive SharePoint URLs.
  • I did compare the contents of http://sitecollectionurl/templateSite contents to http://sitecollectionurl/TemplateSite and they were the same: libraries were last modified on same date, View All Site Content displayed the same content and clicking on any library or list would take you to http://sitecollectionurl/TemplateSite. They were the same site.

Read more about the broad range of technical services AIS provides on our web site.

About Vinita Agrawal

Vinita has been with AIS for almost 7 years developing SharePoint solutions. She is also interested in Windows 8 and mobile development. Prior to AIS she worked at VCU-VISSTA, where she developed people skills. She completed her MS in Computer Science from VCU and her B.E in Electronics and Communications from Bangalore University.