1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Using dashes instead of underlines for blog post generated URLs

Using dashes instead of underlines for blog post generated URLs

4 posts, 0 answered
  1. Chris Dodge
    Chris Dodge avatar
    16 posts
    Registered:
    17 Dec 2009
    18 Jun 2010
    Link to this post
    Hi,

    I'm seeing that the default behavior of the Sitefinity Blog controls is to generate URLS that use underscores ('_') rather than dashes ('-') when substituting for spaces.

    E.g.

    /blog/10-06-14/My_New_Blog_Post.aspx

    rather than
    /blog/10-06-14/My-New-Blog-Post.aspx

    Our SEO consultant is recommending that we use dashes for all of our URLs.

    Is there a way to change this auto-generated URL behavior?

    Thank you,

    Chris
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    21 Jun 2010
    Link to this post
    Hi Chris Dodge,

    Under <cmsEngine> section of the web.config there is a Blogs provider declaration. In the provider declaration you will find a property urlWhitespaceChar which is set to underscore. You could change it to dash.

    You should change the urlWhitespaceChar value under <blogs> node as well.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Chris Dodge
    Chris Dodge avatar
    16 posts
    Registered:
    17 Dec 2009
    21 Jun 2010
    Link to this post
    Thanks,

    That seems to work, although I found the underscores very sticky and I had to go view each blog post (which still have underscore), but when I revisited the page, they changed over to dashes.

    We'd like to be able to do the same with News items. I see the same property in the web.config in the other content sections, but even if I change the urlWhitespaceChar value, I still see an underscore.

    - Chris
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    21 Jun 2010
    Link to this post
    Hi Chris Dodge,

    You should change the property in the provider declaration and inside <news> node. There could be some reference left for the old items, but the white space should be properly replaced for the newly created posts.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 0 answered