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

Forums / Deployment / URL Rewriting w/ source *.htm pages

URL Rewriting w/ source *.htm pages

4 posts, 0 answered
  1. Avonelle Lovhaug
    Avonelle Lovhaug avatar
    2 posts
    Registered:
    25 Oct 2009
    05 Nov 2009
    Link to this post
    I'm having trouble getting URL rewriting to work when the original page had a *.htm" or "*.html" extension.

    It seems to be working okay if the original page was an ASPX page.

    Is this not possible? It seems like since a lot of people would move to a CMS from a static HTML environment, this would be an important feature. (I also tried the Additional Page URLs feature with an HTM extension without success.)

    Suggestions welcome. Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Nov 2009
    Link to this post
    Hi Avonelle Lovhaug,

    You can create an IHttpHandler or IHttpModule. Then get the current request from the HttpContext and if your page is with the same name but with different extension, redirect it to the same ICmsPage.

    Regards,
    Ivan Dimitrov
    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. Avonelle Lovhaug
    Avonelle Lovhaug avatar
    2 posts
    Registered:
    25 Oct 2009
    05 Nov 2009
    Link to this post
    Ivan,

    Thanks for the reply. These are NOT pages that are necessarily the same file name with just a different extension. They will have different names and in some cases be in a different folder. So we really need to set up a bunch of rules like the URL rewriting functionality provides.

    Is there a way to make it work when the original page has an HTM or HTML extension?

    --Avonelle

  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    06 Nov 2009
    Link to this post
    Hi Avonelle Lovhaug,

    In order to perform rewriting of htm/html pages, you should map these extensions to the ASP.NET ISAPI. If you do not do it, the request will not reach Asp.Net and Sitefinity at all, so the URL Rewriter will not be even aware that a request has been made.
    If you are running IIS7 in integrated pipe line mode, then you have wildcard mapping turned on (all request are going for Asp.Net processing). 

    Once you have the mapping (or the wildcard mapping), add the highlighted to the web.config file:
    <cms defaultProvider="Sitefinity"
     pageExtension=".aspx"
     additionalExtensions=".htm, .html
    ...

    In this case Sitefinity will be aware that the htm/html requests should be processed. 

    I hope this helps. 

    Sincerely yours,
    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