More in this section

Forums / Developing with Sitefinity / Rewriting Extensionless URL in IIS6

Rewriting Extensionless URL in IIS6

4 posts, 0 answered
  1. IH
    IH avatar
    11 posts
    Registered:
    13 Jan 2010
    15 Jan 2010
    Link to this post
    Hello,

    I have a situation where I am trying to access the /news page (<cms pageExtension="" ...>) via a url rewriting rule


        
    <rule> 
            <url>/news/category/(.*)</url> 
            <rewrite>/news?NewsCatName=$1</rewrite> 
        </rule> 


    I have got IIS 6.0 configured to send all the 404 to /sf404.aspx.

    The problem I am getting is when I access /news/category/MainCategory it throws an error:


    Server Error in '/' Application.  
    --------------------------------------------------------------------------------  
     
    The resource cannot be found.   
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.   
     
    Requested URL: /sf404.aspx  
     
     
    --------------------------------------------------------------------------------  
    Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082  


    From what I can see is this is because of URL being extension less. Fyi I have got the settings applied as:
    http://www.sitefinitywatch.com/notes/08-12-11/URL_Rewriting_Webinar_Notes.aspx

    I have also tried by adding this:
     
     
     <services> 
            <add type="Telerik.Cms.Engine.ContentUrlRewriterService, Telerik.Cms.Engine" /> 
    </services> 
     
     

    But still no joy.

    The question is .. is there some problem with sitefinity that it is just ignoring all the rewriting when there is no extension?

    Thanks
    IH
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Jan 2010
    Link to this post
    Hello IH,

    Could you please try to add a wildcard mapping, so all requests could go to Asp.Net? This way, you should be able to prevent the additional redirect to sf404.aspx. When using this feature, please make sure that you have set the pageExtensions to "" (empty string) in the web.config file:

    <cms defaultProvider="Sitefinity"
     pageExtension=""
     projectName="37sp2"
     disabled="false"
     pageEditorUIMode="Overlay">

    Let me know about the results. 

    Greetings,
    Georgi
    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.
  3. IH
    IH avatar
    11 posts
    Registered:
    13 Jan 2010
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Jan 2010
    Link to this post
    Hello IH,

    Exactly. The other scenario is logged for improving, right now we are reproducing the same issue as reported. By having wildcard mapping though, there will be no redirect to sf404 and the things should work just fine. 

    Best wishes,
    Georgi
    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.
Register for webinar
4 posts, 0 answered