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

Forums / Developing with Sitefinity / Reserved characters in URL

Reserved characters in URL

4 posts, 0 answered
  1. Darren
    Darren avatar
    72 posts
    Registered:
    19 Mar 2008
    03 Jul 2008
    Link to this post
    Is there a complete list of characters which SiteFinity replaces with underscores in page URL's?
    For instance, the characters <space> ? . ! , ' are all replaced with underscores.

    I have code which highlights newslist article selections by comparing article URL's to news articles but I have to take into account characters in the title being substituted in the URL.

    Thanks in advance.
  2. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    08 Jul 2008
    Link to this post
    Hi Darren,

    The regular expression that we use to capture all the white spaces used in URLs is: [^\w\d-]+
    You can see that it would catch anything that is not a word, figure, or a hyphen.

    Hope this clarifies the situation.

    All the best,
    Vassil
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Jimmy
    Jimmy avatar
    1 posts
    Registered:
    05 Mar 2007
    07 Aug 2008
    Link to this post
    Does it have to be underscores?

    Can the url be replaced with hyphens/dashes (-) instead?

    If so how is it achieved?

    Thanks
  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    07 Aug 2008
    Link to this post
    Hello Jimmy,

    Yes, you can use hyphen. If you open web.config file and go to GenericContent based modules you'll find following property:
     
    urlWhitespaceChar="_" 

    Replace the underscore with the desired character and your urls will be changed.

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    Kind regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered