More in this section

URL rewriting

5 posts, 0 answered
  1. Zyad Rujeedawa
    Zyad Rujeedawa avatar
    31 posts
    Registered:
    18 Feb 2010
    18 Feb 2010
    Link to this post
    Hi,

    I've created a recipe list control, which list all the recipes in my site.

    I need to create a recipe detail page.
    I wish to create just on page, and passing the idrecipe to load the correct one.

    How can I use rewrting in sitefinity to get this done, so that the user does not see the IDRecipe in the querystring.

    Page Created :  RecipeDetails.aspx
    Parameters :  IDRecipe as querystring

    Desired Rewriting URL :  http://mysite/recipe/[RecipeName].aspx

    Thanks for your help,
    Zyad
  2. Zyad Rujeedawa
    Zyad Rujeedawa avatar
    31 posts
    Registered:
    18 Feb 2010
    18 Feb 2010
    Link to this post
    Here's what I did

    I enabled those 2 sections in the web.config file
    <section name="urlrewrites" type="Telerik.Cms.Web.AdvancedUrlRewriter, Telerik.Cms"/>

    <add name="Cms" type="Telerik.Cms.Web.CmsHttpModuleUrlRewrite, Telerik.Cms"/>

    I added my rule

    <telerik>
      ...
     
    <urlrewrites>
       
    <!-- Add your rule elements here -->
       
    <rule>
         
    <url>[input URL pattern]</url>
         
    <rewrite>[replaced URL]</rewrite>
       
    </rule>
     
    </urlrewrites>
      ...
    </telerik>


    But It seems that the rule section is not gettign triggered at all.

    Any help ?


    I enabled
  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Feb 2010
    Link to this post
    Hello Zyad Rujeedawa,

    Thank you for using our services.

    The rewriter matches requested urls using regular expressions and then rewrites them using some kind of patter using regular expressions again. Here is a webinar which samples its use: URL Rewriting In Sitefinity. However if you are passing for example item IDs in query string and want to rewrite this with item name you could also write a custom HttpHandler to handle the request and rewrite urls.

    Kind regards,
    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.
  4. Zyad Rujeedawa
    Zyad Rujeedawa avatar
    31 posts
    Registered:
    18 Feb 2010
    18 Feb 2010
    Link to this post
    Got it working.

    Error was due to IIS 7
    I had to change the  CmsHttpModule in the both places in the web.config depending on the managed pipeline mode my site is running with.
    i.e
    <system.webserver> config section:


    However, i managed to write an URL to another one, but none of my regex syntax are working.
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Feb 2010
    Link to this post
    Hi Zyad Rujeedawa,

    You can use some online tools to test regular expression (like this one). You can also find tools like this one which will help you build regular expressions.

    Greetings,
    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.
Register for webinar
5 posts, 0 answered