Kentico 10 Server Error for Multiple Sites on a Single Domain
If you are running an instance of Kentico that has multiple sites on a single domain, you may run into a 500 server error if you haven't properly updated your web.config file. In this post I will show you how to update your config file to fix this issue.
Recently, I ran into an issue running multiple Kentico sites on a single domain after upgrading from Kentico 9 to Kentico 10. Initially, I would just get a 500 server error with no helpful information from the browser and the error did not appear in the Windows event log.
To get more information on the error I set compilation debug to true on line 96 of the Kentico 10 web.config file.
After loading the page again I was able to get the error "Cannot add duplicate collection entry of type 'add' with unique key attribute 'sequence' set to '/CMSTemplates'" on line 226
To fix this, I removed the sequences before adding them
<security> <requestFiltering> <!-- Disable direct access to these files which are used only internally by CMS application --> <denyUrlSequences> <remove sequence="/CMSTemplates"/> <remove sequence="/CMSPages/PortalTemplate.aspx"/> <add sequence="/CMSTemplates"/> <add sequence="/CMSPages/PortalTemplate.aspx"/> </denyUrlSequences> </requestFiltering> </security>
This prevented the duplicate collection entry and the site was able to load properly.