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

Forums / Developing with Sitefinity / url rewrite in sitefinity

url rewrite in sitefinity

17 posts, 0 answered
  1. Gerard Brandon
    Gerard Brandon avatar
    4 posts
    Registered:
    14 Feb 2006
    22 Nov 2007
    Link to this post
    Hello,

    I want to use urlrewrite feature of sitefinity and have read the data about it in user manual, and have implemented it likewise.
    I added following sections to web.config

    <sectionGroup name="telerik">

    <section name="urlrewrites" type="Telerik.Cms.Web.AdvancedUrlRewriter, Telerik.Cms"/>
    </sectionGroup>



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

    <urlrewrites>
    <rule>
    <url> product(.*)\.aspx </url>
    <rewrite> Products.aspx?ProdId=$1</rewrite>
    </rule>
    </urlrewrites>



    and the site does not gives any error,

    but the urlrewriting feature is not working.

    If i give something like product2.aspx then it does not redirects to products.aspx?prodid=2 and gives a page not found exception saying

    page with the name product2.aspx does not exist.

    It is an urgent issue for me , please suggest some solution.

    I am using sitefinity3.0
  2. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    22 Nov 2007
    Link to this post
    Hello Gerard,

    Most probably, there are spaces before and after the url and rewrite inside values. I can see from your previous post that there is a space between the opening url tag and the 'product(.*)\.aspx'. The same is with the closing url tag, as well as the opening rewrite tag.

    Let us know if this does not fix the problem.

    Sincerely yours,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Christian
    Christian avatar
    23 posts
    Registered:
    31 Jul 2008
    25 Mar 2009
    Link to this post
    I have the same problem. I did everything that is described in your manual. I have no additional spaces between the tags.
  4. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    26 Mar 2009
    Link to this post
    Hi Christian,

    Can you post the UrlRewriting rule that you're using?

    Gabe Sumner
  5. Christian
    Christian avatar
    23 posts
    Registered:
    31 Jul 2008
    27 Mar 2009
    Link to this post
    Hallo Gabe,

    i found the solution in your blog. The error was caused by a wrong configuration of web.config due to the changes in iis7.

    Best wishes
    Christian
  6. Jason
    Jason avatar
    9 posts
    Registered:
    18 Sep 2008
    20 May 2010
    Link to this post
    Christian, what post did you find the solution in? I am having the same problem and all I am trying to do is a very simple rewrite:

    <urlrewrites>
      <rule>
        <url>sitemap.xml</url>
        <rewrite>sitemap.ashx</rewrite>
      </rule>
    </urlrewrites>

    I am using IIS 7.5 with a classic app pool and the following configuration
    <configSections>
      <sectionGroup name="telerik">
      ...
      <section name="urlrewrites" type="Telerik.Cms.Web.AdvancedUrlRewriter, Telerik.Cms"/>
      ...
      </sectionGroup>
    </configSections>
     
    <httpModules>
    ...
    <add name="Cms" type="Telerik.Cms.Web.CmsHttpModuleUrlRewrite, Telerik.Cms"/>
    ...
    </httpModules>

    I am using 3.7 SP3

    Thanks!
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    20 May 2010
    Link to this post
    Hi Jason,

    The registration for IIS 7 - is in the <modules> section (within <system.webServer> section) of your web.config.

    Regards,
    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.
  8. Jason
    Jason avatar
    9 posts
    Registered:
    18 Sep 2008
    20 May 2010
    Link to this post
    Thanks for the reply Ivan,

    So, I made the change so that I now have this in my web.config:

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

    and I am still getting 404 errors when trying to hit my sitemap.xml page.
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    20 May 2010
    Link to this post
    Hello Jason,

    Here is a sample project that I have tested and attached some time ago in the forums -  General Discussions Rewrite. The same problem was discussed there, so you could find something you have missed. Could you try to run the project through VS web server to narrow down whether the problem comes from IIS .

    Sincerely yours,
    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.
  10. Jason
    Jason avatar
    9 posts
    Registered:
    18 Sep 2008
    20 May 2010
    Link to this post
    Ivan, I tried the sample and it works on the VS web server, but does not work on IIS.
  11. Jason
    Jason avatar
    9 posts
    Registered:
    18 Sep 2008
    20 May 2010
    Link to this post
    So I've got it working, I saw Vlad's recommendation in this post to replace CmsHttpModule to CmsHttpModuleUrlRewrite in both places of the config file. I did that and it still didn't work at first, but when I changed the app pool to integrated pipeline mode it started working. I still can't seem to get it to work under Classic mode however.
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 May 2010
    Link to this post
    Hello Jason,

    Generally the dot is escaped with back slash in the url rewriting. As far as I see in your code you are typing the rules directly without escaping the dots.


    <urlrewrites>
      <rule>
        <url>sitemap.xml</url>
        <rewrite>sitemap.ashx</rewrite>
      </rule>
    </urlrewrites>


    Sincerely yours,
    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.
  13. Jason
    Jason avatar
    9 posts
    Registered:
    18 Sep 2008
    21 May 2010
    Link to this post
    Hi Ivan,

    I am just working with a more simplified sample for the moment, I took the sample project you provided and I am trying to rewrite "abc" to "default.aspx". It works well on the VS web server, and IIS 7.5 with a Integrated Pipeline app pool, but if I switch it to a Classic .net app pool, it doesn't work and I get a 404. My production environment is using a classic app pool, so I have to figure out how to get this working in that scenario.

    Thanks for your help,
    Jason
  14. James Reategui
    James Reategui avatar
    22 posts
    Registered:
    14 Oct 2008
    09 Jul 2010
    Link to this post
    I found that I could not get URL rewriting to work in classic mode, had to be using integrated mode (for the app pool).
    Also, I found I had to set to use CmsHttpModuleUrlRewrite instead of CmsHttpModule in both places where it is configured in the web.config.

    Hope that helps somebdoy
  15. jan
    jan avatar
    3 posts
    Registered:
    30 Jul 2008
    17 Aug 2010
    Link to this post
    Jason,

    Were you able to get the urlrewrites working for IIS6 and IIS7?  We're having a similar issue when trying to upgrade from v3.2 to v3.7 and the URL rewrites are causing the site to error out.  I'm also running IIS7 on development while IIS6 is on production.

    Thanks!

    Jan
  16. Jason
    Jason avatar
    9 posts
    Registered:
    18 Sep 2008
    17 Aug 2010
    Link to this post
    Jan,

    No, sorry, I never was able to get it working. I still have the rewrite config settings in place, but if you go to my site,
    http://www.eastpointsystems.com/sitemap.xml gives a 404, but http://www.eastpointsystems.com/sitemap.ashx works just fine. I just gave up after spending a lot of time on it and not getting anywhere.

    Sorry that I couldn't be of any help, but please let me know if you are able to find a solution!

    Jason
  17. Scott Rozman
    Scott Rozman avatar
    93 posts
    Registered:
    10 Oct 2012
    19 Sep 2010
    Link to this post
    Jason, if you are still monitoring this thread, check out the post on my blog regarding HttpRedirect for this. It may work for you.
Register for webinar
17 posts, 0 answered