Hot answers tagged

23

Using IIS URL Rewrite (or firewall/load balancer/CDN) is appropriate for all domain-name and protocol changes (i.e. everything to the left of "/"). This covers #1, #2, and #3 from your list. I'd argue that Sitecore should be used for any redirect (other than the above redirects) that editors/authors are responsible for. Putting those redirects in Sitecore ...


9

If it was my decision I would insist that everything that is configured once and you don't plan to change it (like 1, 2 and 3 from your list) always should be set before they even hit Sitecore. IIS UrlRewrite module is one of the options. No points in wasting any IIS resources for them. They won't be changed by authors, editors, marketers or administrators ...


8

Loooong time ago I wrote a blog post describing how to handle this issue. It was for Sitecore 6.5 but I guess it should work on any other version as well. Sitecore serves media items even with incorrect extensions The idea is that there is an extra processor added to httpRequestBegin pipeline which checks whether the extension used in requested url is same ...


8

The simplest way would be to separate the navigation from the content structure. So create your navigation to work from a Datasource root item that defines how your nav is built. Each item can then contain fields for the text and link. Then build your content tree as you want your Url's to be set. So your content tree would then look something like: ...


5

Have you checked the configuration in LinkManager? <linkManager defaultProvider="sitecore"> <providers> <clear /> <add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel" addAspxExtension="false" alwaysIncludeServerUrl="false" encodeNames="true" languageEmbedding="asNeeded" languageLocation="filePath" ...


5

I'm not sure exactly what your asking for here but if you want to show the 'real' file extension for PDFs, Docs, Images etc then I'd suggest enabling Media.RequestExtension like so: <setting name="Media.RequestExtension" value="" /> To prevent duplicate urls for files you may be able to use an MediaRequestHandler as described by Martin Davies here: ...


4

As developers, we sometimes too focused on our application and forget about other cool tools we have around us. In your question you are referring to two options - IIS and Sitecore, but there is at least one more. I am talking about network hardware that handles traffic between user and IIS. It is not uncommon to find 'smart' Load Balancer or Firewall that ...


4

Sitecore SXA has a good implementation of this. They register it as a HttpRequestBegin pipeline handler. Very simplified version of how it works (as I understand it) Check the request url ends with /robots.txt Get the context site and make sure we want to process the request for the given site Check the cache for data for the context site, write it to the ...


4

One way you could do it: create a base template with the checkbox(es) you want add this base template to all project templates needed create a (custom) rendering that has the meta tag as output based upon the checkboxes (include the necessary checks in case those are not present) add the rendering to the Meta partial design (which probably is already ...


3

The solution I am currently considering is to have a h1-text on the landing page Sitecore item itself. When the components are rendered the Hero controller will take this h1-text, wrap the Hero image in a h1 tag and use the h1-text as the Hero image alt tag. Before doing this it will check to see if there are any other Hero renderings present on the page. ...


3

Sitecore does not set error status codes properly. The code handling no access redirect is done on the method RedirectOnNoAccess of the processor Sitecore.Pipelines.HttpRequest.ExecuteRequest, Sitecore.Kernel. SXA sets the header for NotFound and InternalServerError, but not for Forbidden. This is done via processor Sitecore.XA.Feature.ErrorHandling....


3

This is going to be a horrible linky answer (Sorry moderators its too much code to put in an answer). But Sitecore's habitat example site that does this for assets. In the foundation.assets project, it gets styling and JavaScript from renderings and page content to assemble later on the page. Specifically it is this processor in the mvc.getPageRendering ...


3

You're taking the correct approach by using LinkManager to generate the URL for the canonical tag. LinkManager should always generate the canonical everywhere a content item is referenced. It's critical that whatever LinkProvider you're using is configured properly: <add name="custom" type="Custom.LinkProvider, Custom.Linking" ...


2

Does the Sitecore CMS allow for meta-data tagging using the schema.org taxonomy? Yes it does. And pretty much any other taxonomy I can think of. Sitecore allows you to organise and structure your content in any way you see fit, including the adding of additional metadata to support both internal and external searching and filtering. A few references, ...


2

Sitecore will capture information about the request in the analytics, but if you are just sending the data to the 3rd party analytics API you can probably just use the Request.Browser object that is just part of the MVC Controller request. You could use the following properties public ActionResult MyRendering() { var os = Request.Browser.Platform; ...


2

This is an alternative to the approach you already posted. Keep the approach to the markup that you planned on using with the <h1> wrapped around an <img> with its alt attribute set based on a field on the page item. The difference comes in how you determine if you need to add the <h1> and set the alt attribute or not. Rather than ...


2

Additional, If you only want to prevent Google web crawlers from indexing a page, then you need to add below tag on your page, in the same way as Vipin define in his answer - <meta name="googlebot" content="noindex"> Instead of a meta tag, you can also return an X-Robots-Tag header with a value of either noindex or none in your response. below is an ...


2

You can manually create robots.txt file and list pages that you want to exclude for search clawlers: User-agent: * Disallow: /page1 Disallow: /page2 ...etc You can use official Sitecore SXA module where you can setup sitemap and many other features: https://doc.sitecore.com/developers/sxa/17/sitecore-experience-accelerator/en/configure-a-sitemap.html. You ...


2

You can add a field in your Sitecore item template such as add a checkbox field for "Do not Allow Search Engine to Index Page", based on this field value you can render a meta tag in your HTML page head section: <META NAME="robots" CONTENT="noindex"> you can find more information here https://blog.hubspot.com/marketing/how-to-unindex-pages-from-...


2

I've implemented a SEO friendly version of a SXA listing page using the search components. What I actually did was creating a custom component that uses the scope defined in SXA to do the search, as well as the pagination from SXA. The output is done with variants so we are reusing lots of SXA stuff. It's a bit much to show all code here, but lets try to ...


1

One solution would be to create a custom renderField pipeline processor like this: public void Process(RenderFieldArgs args) { Assert.ArgumentNotNull(args, "args"); if (Sitecore.Context.Site.DisplayMode == Sitecore.Sites.DisplayMode.Edit) return; var field = Sitecore.Data.Fields.FieldTypeManager.GetField(args....


1

I'm not a SEO specialist but I was always told that this indeed might be seen as duplicate content. What I do when using ItemLanguageFallback: Create a canonical url that points towards the original language (so in English that would be the current page but in Korean that would also be the English version) Create a list of alternate urls to list all ...


1

While it is possible to implement a solution with physical files, this approach has some disadvantages: To apply a change you have to physically change a file on the server. If you have scaled setup with multiple CD server, you would have to apply changes to robots.txt on each of the servers. In contrary, if you generate robots.txt files on the fly based ...


1

It's quite difficult to answer this question with certainty as it may be a bit of trial and error, but you can try this rewrite rule <rule name="1" stopProcessing="true" patternSyntax="ExactMatch"> <match url="xxxx/yyy/page/19/?paged=20" /> <action type="Redirect" url="/aaaa/bbbbb"/> </rule>


1

SXA supports multiple languages Sitemap from SXA 1.6- check the release notes here for more details- The SEO Sitemaps aggregate all the available sites under a single hostname, and support multiple languages 494598 9788 In your case you can customized the Sitemap XML generator for your SXA version, follow the below steps: 1) Create a new class that ...


Only top voted, non community-wiki answers of a minimum length are eligible