Tuesday, April 20, 2021

Episerver Search - Troubleshooting

 https://medium.com/@jayesh.madhwani335/enable-search-in-episerver-cms-11-f2498ad17c64

  • Check if 404 is hidding endpoint

This article will help you with installing and configuring the Search feature in Episerver CMS11.

First, we need to install the Episerver.Search and Episerver.Search.Cms Nuget package to your Episerver Web application.

This will add below the config section to your web.config file.

<episerver.search active=”true”>
<namedIndexingServices defaultService=”serviceName”>
<services>
<add name=”serviceName” baseUri=”
https://[yoursitehostname]/IndexingService/IndexingService.svc" accessKey=”local” />
</services>
</namedIndexingServices>
<searchResultFilter defaultInclude=”true”>
<providers />
</searchResultFilter>
</episerver.search>

Next, browse https://[yoursitehostname]/IndexingService/IndexingService.svc

if you get IIS mapping error then you need to install HTTP activation from Turn Windows feature on or off → .Net Framework Advanced Services →WCF Services → HTTP Activation.

try browsing the Url again, if you get below error

No elements matching the key ‘IndexingServiceCustomBinding’ were found in the configuration element collection.

then add the below config section to your web.config under Configuration → system.serviceModel

<bindings>
<webHttpBinding>
<binding name=”IndexingServiceCustomBinding”
maxBufferPoolSize=”1073741824"
maxReceivedMessageSize=”2147483647"
maxBufferSize=”2147483647">
<security mode=”Transport”>
<transport clientCredentialType=”None”>
</transport>
</security>
<readerQuotas maxStringContentLength=”10000000" />
</binding>
</webHttpBinding>
</bindings>

you should now be getting below message after browsing the indexing service url

Now we are ready to create the indexes for our Episerver content.

Go to Episerver CMS →Admin → Admin Tab →Index Site Content

or

Goto

https://[yoursitehostname]/EPiServer/EPiServer.Search.Cms/IndexContent.aspx

Clicking on the “Start Indexing” button will create index files under your App_data/Index/Main folder.

if you see below error when trying to load IndexContent.aspx page

System.Security.SecurityException: Request for principal permission failed.

then

remove this virtual role from the Web.Config file.

<add name=”Administrators” type=”EPiServer.Security.WindowsAdministratorsRole, EPiServer.Framework” />

and add below virtual role.

<add name=”Administrators” type=”EPiServer.Security.MappedRole, EPiServer.Framework” roles=”WebAdmins,Administrators” mode=”Any” />


Tuesday, April 13, 2021

IIS - Create a from HTTP to HTTPS redirect

 1. Install the url rewrite module extension below.

https://www.iis.net/downloads/microsoft/url-rewrite


2. Then add this to the web.config inside <system.webServer>

  <rewrite>
            <rules>
                <rule name="HTTPS Redirect" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" 
                    appendQueryString="false" redirectType="Permanent" />
                </rule>
            </rules>
        </rewrite>

Make sure you have https bindings set and that the firewall accepts incoming on 80 and 443.

Friday, April 9, 2021

500 Error - Config to see more info

 <system.webServer>

    <httpErrors errorMode="Detailed" xdt:Transform="Replace" >

    </httpErrors>

    <asp scriptErrorSentToBrowser="true" xdt:Transform="Insert" />

Wednesday, April 7, 2021