More in this section

Forums / Developing with Sitefinity / URL Rewriting with localization - troubleshooting rules...

URL Rewriting with localization - troubleshooting rules...

2 posts, 0 answered
  1. clayman
    clayman avatar
    38 posts
    23 Sep 2009
    23 Nov 2009
    Link to this post

    I need to set up my site to employ url re-writing.  I'm wondering if localization (using PathPrefix persistence mode) needs to be accounted for in the url rules?

    Just to confirm I set it up properly:

    Added the following urlrewrites <section> to <configSections>.
     <sectionGroup name="telerik"
       <section name="urlrewrites" type="Telerik.Cms.Web.AdvancedUrlRewriter, Telerik.Cms"/> 

    Replaced the default CmsHttpModule httpModule with CmsHttpModuleUrlRewrite.
      <add name="Cms" type="Telerik.Cms.Web.CmsHttpModuleUrlRewrite, Telerik.Cms"/> 

    Now for the rules, I have some pages that use a querystring and some that don't.

    Here is an example of the querystring rules:

    Here is an example of the direct mappings:

    Neither of these rules is working -- I just get 404s -- and I've tried several variations. 

    Could it be that localization is interfering with the rewriting? 

  2. Georgi
    Georgi avatar
    3583 posts
    28 Oct 2016
    24 Nov 2009
    Link to this post
    Hi Clayman,

    Thank you for posting your question in our forums.
    The setup of the URL Rewriter is okay, but the problem comes from the fact that the pattern and the rewrite rule are switched. You should do it exactly the opposite way, let me give you an example:

    You should have the match-rule in the <url> element, and the replace pattern in the <rewrite> element.

    As for the localization question, the PathPrefix will be part of the URL so you can write your rules by having it in mind as well.

    I hope this answers the question.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered