Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3699052
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:03:23+00:00 2026-05-19T05:03:23+00:00

Working with multiple language sites in Sitecore 6.2 I’d like to be able to

  • 0

Working with multiple language sites in Sitecore 6.2 I’d like to be able to have Sitecore replace ” ” (empty space, traditionally replaced with %20) in URLs with a hyphen.

E.g. http://www.MySite.com/Hello World > http://www.MySite.com/Hello-World

So far no problem, we just add another entry to encodeNameReplacements

<replace mode="on" find=" " replaceWith="-" />

Then to prevent our content authors from creating items with a hyphen in their names (which Sitecore would understand as having a space when reading their URLs, resulting in a 404 Not Found) we can add the hyphen to the list of characters forbidden in item names, using

 <setting name="InvalidItemNameChars" value="\/:?&quot;&lt;&gt;|[]-"/>

This all works fine – until I try and create a new language definition. Languages in Sitecore can either use a simple language code (e.g. en, da, de etc) or a language and region code (ISO) such as en-GB, da-DK, de-DE etc. For our sites we will need the regional codes as we intend to support regional language variation (e.g. Swiss French and Swiss German). But of course I’ve now forbidden the hyphen in item names (and languages, as everything else in Sitecore, are defined as items). In fact Sitecore demands that a language name is properly constructed as a culture identifier, so I can’t assign a language a descriptive name (e.g. American English) with the iSO code specified in the ISO code field of the template.

Can anyone suggest a suitable solution to this? Should I remove the hyphen from the InvalidItemNameChars node and write a custom code snippet that traps attempted creation of hyphenated item names i? If so, how should I interecpt the creation event?

I’m loathe to customise the interface where it isn’t necessary, especially as I’m concerned this may create problems for Sitecore version updates, so if there are other solutions I’d love to hear them.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T05:03:24+00:00Added an answer on May 19, 2026 at 5:03 am

    This uses the rules engine to replace special characters such as spaces in item names:

    https://marketplace.sitecore.net/en/Modules/Item_Naming_rules.aspx

    If you didn’t replace, but just translated, when processing URLs, Sitecore’s item resolver would try to look for item names with dashes rather than spaces, and would not find matching items. If you don’t actually replace the characters, then you would need to override the item resolver.

    If you want to leave the names with spaces visible to the user, but actually name the items with dashes, then you could set the display name for the item to the original value with spaces when you rename the spaces to dashes, but I would recommend against that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.