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

URL Rewriting

10 posts, 0 answered
  1. Rob
    Rob avatar
    7 posts
    Registered:
    18 Jan 2008
    19 Nov 2008
    Link to this post
    Hi Guys,

    I'm working on my first real Sitefinity site. So far it's looking great. I really love the stuff..

    Enough sucking up :)

    I created a intra-site module as you call it and want to add url rewriting to it.
    The page that shows the list of brands is called "brands.aspx". Now I want the details to show on the same page using an url like this:
    "brands/myBrandName.aspx"
    I configured the web.config using the guidelines:
    - Added section in sectionGroup:
    <section name="urlrewrites" type="Telerik.Cms.Web.AdvancedUrlRewriter, Telerik.Cms"/> 

    - Changed HttpModule setting:
    <add name="Cms" type="Telerik.Cms.Web.CmsHttpModuleUrlRewrite, Telerik.Cms"/> 

    - Added the section urlrewrites to the telerik node:
    <urlrewrites> 
        <rule> 
            <url>brands/(*).aspx</url> 
            <rewrite>brands.aspx?brandId=$1</rewrite> 
        </rule> 
    </urlrewrites> 

    The page http://localhost/mysite/brands.aspx still works fine.
    When I try http://localhost/mysite/mybrand.aspx I get a 404 error.

    I am using Vista, maybe this has something to do with it.

    Kind regards,

    Rob
  2. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    19 Nov 2008
    Link to this post
    What does http://localhost/mysite/brands/mybrand.aspx do?

    I think the UrlRewriting rule you're using needs a leading "brands" keyword in the URL before it will be used

    Gabe Sumner
    http://www.goondocks.com/
  3. Rob
    Rob avatar
    7 posts
    Registered:
    18 Jan 2008
    19 Nov 2008
    Link to this post
    Hi Gabe,

    Thanks for your reply.
    You are right about the /brands/.
    I made a typo in my post, but I did use the correct url to test it in my site. So this doesn't help I'm afraid...

    Rob
  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    20 Nov 2008
    Link to this post
    Hi Rob,

    Have you changed the CmsHttpModule in the both places in the web.config depending on the managed pipeline mode your site is running with.

    In case your site is set on IIS7 with integrated pipeline mode, change the CmsHttpModule in the <system.webserver> config section:

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


    ... otherwise in the <system.web>:

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


    Please check this out. Seems our guidelines regarding this topic are out of date.
    Hope this is helpful.

    Kind regards,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Rob
    Rob avatar
    7 posts
    Registered:
    18 Jan 2008
    26 Nov 2008
    Link to this post
    Hi Vlad,

    Thanks for the reply. It's working now, that seemed to do the trick.

    Documentation really needs updating regarding this subject.

    Thanks again for the help.

    Rob
  6. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    09 Feb 2011
    Link to this post
    We are using Sitefinity  Telerik.Cms.Web.CmsHttpModuleUrlRewrite module to redirect urls.

    We want to place  the section  <urlrewrites> in one xml file or some other  web.config file other than the root web.config file.

    Can we do this? as we have so many url redirections and the size of the web.config is a bit big.So I want to move this section to another xml file or web.config file.

    Please guide me on this?

    Thanks
    Venkat
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Feb 2011
    Link to this post
    Hi ,

    Unfortunately changing the location of the rewrite attribute is not supported.

    Kind 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. rendy
    rendy avatar
    2 posts
    Registered:
    07 Nov 2010
    29 Mar 2011
    Link to this post
    hi,
    i hav change CmsHttpModule in the <system.webServer> and <httpModules>
    and its working but the problem is when i add this
    <urlrewrites>     
          <rule>   
            <url>home/programs/coursespage/^([^/]+)/?$</url>           
            <rewrite>home/programs/coursespage.aspx?id=$1</rewrite>               
          </rule>
    </urlrewrites>

    and i get 404 page error.





  9. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    31 Mar 2011
    Link to this post
    Hi rendy,

    It seems that there is some problem with your regular expression. You can test your regular expressions before you use it here.

    Kind regards,
    Radoslav Georgiev
    the Telerik team
  10. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    01 Apr 2011
    Link to this post
    In our application we need to redirect the user from a old website page to the new website page. Sitefinity has built in Module to rewrite the url. The below link clearly explains it.

    http://www.sitefinitywatch.com/blog/09-01-08/URL_Rewriting_with_Sitefinity_s_AdvancedUrlRewriter.aspx

    In our application we have plenty of  URLS to rewrite and we dont want to put all these stuff in web.config. So We have created a Custom Module to rewrite the URLs. This module reads the xml file (which contains a set of url rewrites and the format is same as url rewrites defined in the web.config.) and rewrites the URL.

    I have posted the code and details in my blog , please go through the article to solve it.

    http://vangalvenkat.blogspot.com/2011/03/sitefinity-37-ustom-url-rewrite-module.html

Register for webinar
10 posts, 0 answered