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

Forums / Developing with Sitefinity / Url rewrite from About-Us to AboutUs

Url rewrite from About-Us to AboutUs

2 posts, 0 answered
  1. ermi
    ermi avatar
    5 posts
    Registered:
    15 Jun 2012
    22 Sep 2010
    Link to this post
    That seems easy at first glance because it can be done by:
    <rule>
      <url>About-Us.aspx</url>
      <rewrite>AboutUs.aspx</rewrite>
    </rule>

    But I need to tap on regex to accommodate other pages (without adding all of them in .config) like Page-One.aspx, Page-NinetyNine.aspx etc.

    Basically, I need to remove the hyphens in the inbound urls. Any idea?
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    22 Sep 2010
    Link to this post
    Hello ermi,

    You can try with a rule like this:
    <rule>
      <url>([\w-]+)-([\w-]+)\.aspx</url>
      <rewrite>$1$2.aspx</rewrite>
    </rule>

    This tool will help you build regular expressions for the rewriter.

    Sincerely yours,
    Radoslav Georgiev
    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
2 posts, 0 answered