Posts

Showing posts with the label Multisite

Sitemap and Robots in Sitecore Multisite

Image
In the continuation of my previous blog Steps to be Performed after Multisite Configuration, I am going to discuss two important functionalities in terms of Google search crawling ranking and every website core functionality which are Sitemap and Robots txt implementation.  Create a new Template with two fields Sitemap and Robots. Inherit the above template on the Home page template of both Site nodes. Create a patch file: This patch file will have one pre-processor to allow the URL extension for XML and Txt files and another processor in the httpRequestBegin pipeline to serve Sitemap and Robots txt files. Create a class in your project for the custom processor and use the below code Deploy your application and browse pages: Website-a.com/sitemap.xml Website-b.com/sitemap.xml Website-a.com/robots.txt Website-b.com/ robots.txt If you want to implement the same functionality using A...

Cross-origin Issue in Sitecore Multisite

Image
While working on the Sitecore multisite, I faced the following issue while accessing the API with website-B. This happens when you want to use your web API with another website in Sitecore multisite setup. Cross-Origin Resource Sharing (CORS) is a W3C standard that allows a server to relax the same-origin policy. When you use CORS, a server can explicitly allow some cross-origin requests while rejecting others. Sitecore provides CORS support for Web API services. You can configure CORS in three ways: Globally for all Web API services (configured in the Sitecore.Services.Client.config file). Using an API key. Using the EnableCors attribute. I have used the first option to solve my issue. You need to modify "Sitecore.Services.Client.config" at path {instance}/ \App_Config\Sitecore\Services.Client with registered origins. Create a patch file in the project and add the following section of code and allow origin...

Steps to be Performed after Multisite Configuration

Image
In my previous blog, I discussed Multisite in Sitecore 10 . In continuation of that blog, in this blog, I am going to discuss what are the other important things we need to take care of while renaming or adding a site. Add entries to the <cacheSizes> section for site-specific: For the default site named website, Sitecore adds cache sizes for the website site. While working on the multisite we set up one more site with a different name. Then you need to add a section with the site name and add the caching values for that site. Example: Your site name is Site1 then create a patch file and add the below configuration: Update the Preview.DefaultSite setting value for the additional Site: This setting specifies the default site to be used in Preview mode. For example, if you rename the standard 'website' site, and add e.g., site1, please cha...

Multisite in Sitecore 10

Image
Configuring a multisite in a Single Sitecore instance is an OOTB feature. It means you can share data, templates, rendering, and other items in the same Sitecore Content tree with two different website nodes. Each website node will have its tag and it's managed from Sitecore.Sites.config.  A single Sitecore installation, however, can publish any number of websites, each with its properties. The properties for each site are, by default, stored in the Sitecore Sitecore.Sites.config file.  The Sitecore Sitecore.Sites.config file includes a list of served websites listed in the <sites> section and the definition of the node will be defined into the <site name=”website” …/> tag. Sitecore parses incoming HTTP requests and selects the appropriate site based on the HTTP request parameters. Step 1: Create a new site node into the content tree: Create one more site node in the Sitecore tree. Best practice says each Site node...