Search code examples
urlsitecoreurlencode

EnEncodeNameReplacements is not working in sitecore


When I create new page with the name containing spaces for eg: My Page in sitecore cm and try to navigate to that page in the browser the space is replaced by %20 like this My%20Page. I have even added the EncodeNameReplacements in sitecore.config for replacing whitespace with - but its still not working. Someone please give a solution for this.


Solution

  • Very first thing is, we have to make our page URL SEO friendly. So, in Sitecore, we have the freedom to create an item with a name to be used as URL and DisplayName for human understanding. So, I would advise you that you should create pages with a naming convention like 'my-page' or 'contact-us' and set the Display name for that page.

    So, using the above approach your URLs will be neat and clean, and SEO friendly.