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

Forums / Developing with Sitefinity / Advanced URL Rewriting

Advanced URL Rewriting

5 posts, 0 answered
  1. NimitV
    NimitV avatar
    68 posts
    Registered:
    06 Apr 2010
    07 Apr 2009
    Link to this post
    Hi,

    I have read through the user manual section for URL Rewriting, I have applied the changes to my configuration file and I created this one rule to test with:

     
        <urlrewrites> 
          <rule> 
            <url>(?i)Content_Home\.cfm\?C=5008&amp;SC=1&amp;SCM=0&amp;MI=405&amp;L1M=405</url>  
            <rewrite>home.aspx</rewrite> 
          </rule> 
        </urlrewrites> 

    It seems to kinda work, when I enter the Content_Home.cfm... url it does display the home.aspx page but it does not take me to the home.aspx page. Is there a way to have it forward me to the home.aspx page using the urlrewites?

    Thanks,
    Steve
  2. Parvan
    Parvan avatar
    151 posts
    Registered:
    24 Sep 2012
    07 Apr 2009
    Link to this post
    Hi S. Webb,

    Yes - it is possible to use a redirect approach.
    I have attached a sample class CmsHttpModuleUrlRedirect.

    Setup:

    1. Put the file CmsHttpModuleUrlRedirect.cs in your App_Code folder.
    2. Open you site web.config and change the httpModules section( or modules if you use IIS7 in integrated pipeline mode):
    <modules> 
    ... 
    <add name="Cms" type="Telerik.Cms.Web.CmsHttpModuleUrlRedirect, App_Code"/> 
    ... 
    </modules> 
     
    <httpModules> 
     ... 
    <add name="Cms" type="Telerik.Cms.Web.CmsHttpModuleUrlRedirect, App_Code"/> 
    ... 
    </httpModules> 

    When it matches some of the urlrewrite rules, a redirect will be performed instead of url rewriting.

    Regards,
    Parvan
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. NimitV
    NimitV avatar
    68 posts
    Registered:
    06 Apr 2010
    07 Apr 2009
    Link to this post
    Thanks Parvan.
  4. Joel
    Joel avatar
    1 posts
    Registered:
    27 Aug 2010
    27 Aug 2010
    Link to this post
    Is there a way to use this code when .net 2.0 only installed. System.linq is not available because we are not running .net 3.5. Any way to get around this?
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Aug 2010
    Link to this post
    Hello Joel,

    Thank you for using our services.

    The System.Linq reference is not used in this code. You can remove it and use the solution in .NET 2.0

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