SharePoint site not reading web.config

The last few weeks I’ve been struggling with a problem for which I couldn’t seem to find a solution. I tried implementing the Faceted Search solution found on Codeplex: http://facetedsearch.codeplex.com/. With this solution, it’s possible to enhance the search options of SharePoint to show search facets. With these facets, the user is able to narrow down the search results by specifying things like language, author, content source, etc.

I downloaded the solution file, installed it and followed the steps in the installation guide. But when it came to previewing the ‘Search Facets’ webpart, all I got was a ‘Unkown error occurred’ message. The SharePoint log didn’t provide a clear error message and neither did the event log. I tried redeploying, making sure all web.config settings were correct, nothing seemed to help.

After a few weeks of trying stuff and getting annoyed with a problem which I couldn’t fix, I suddenly noticed that changes I was making in web.config weren’t causing a recycle of the application pool. So I started investigating and found out that even completely stopping the website and application pool in IIS didn’t seem to shut up the site, everything just keeped on working. So apparantly, something else was hosting this site and not the IIS site I thought was hosting.

The site was secured with an SSL wildcard certificate, and there lies the solution. When a wildcard certificate it used, a script (cscript adsutil.vbs set /w3svc/123456789/SecureBindings “:443:web.site.com”) has to be run to bind the correct host header to that SSL secured site. Now I apparantly forgot that step or the IIS setup got corrupted somehow, either way the bind was on the wrong site. So IIS redirected all calls to web.site.com to another SharePoint site.

So you might wonder why I didn’t see the other site instead of the one I was trying to visit? Well that’s because of the alternate access mappings I had setup in SharePoint. With those you can manage which host header belongs to which site, and apparantly this also works even when the call is made through another site than the configured one.

So to conclude: the web.config of another SharePoint site was loaded and therefore it didn’t have the configuration settings needed. That caused Faceted Search to fail with a rather useless error. But now everything is straightened up again and faceted search is working on all sites: woooohooooo! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *