Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • chris 69 posts 92 karma points
    Dec 07, 2010 @ 18:28
    chris
    0

    error handling for non aspx pages in umbraco

    My umbraco installation has been running great. I have some legacy pages where they are either in html or shtml. The custom error works if the 404 on aspx, but if it goes to html/shtml, I get regular 404 with IE, or some silly browsers will throw blank page. Is there a way to use custom error with non aspx pages? How do I do this?

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Dec 08, 2010 @ 15:16
    Tim
    0

    In order to do this, you would need to have access to IIS on the server. In the website properties you can specify custom errors for IIS. Just point the errors that you want (looks like 404 in your case) at the url for your custom 404 page. Here's a link on how to do this in IIS6 it might be slightly different for your version of IIS, depending on wheich version you are running.

    http://www.webmonkey.com/2010/02/create_custom_404_pages/

    You can repeat the process for any other custom error pages that you might have.

  • chris 69 posts 92 karma points
    Dec 08, 2010 @ 15:37
    chris
    0

    the box is mine, I have full control of the server. I tried that above, and it didn't work. I tried setting custom control in asp, in iis as well as in umbracoConfig file, none worked for plain html.

    I'm using IIS 7.5, after looking at google, it seems that there is no way of showing custom error for non aspx, only for aspx pages. There was a talk about converting the appworker into classic from integrated pipeline. Well I'd rather not do that.

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Dec 08, 2010 @ 16:36
    Tim
    0

    Do you have a wildcard map set up for the site (for extensionless urls)? If not, you could try setting that up, as that should route requests for non-aspx file through the .net pipeline, resulting in the correct 404 errors etc.

  • chris 69 posts 92 karma points
    Dec 09, 2010 @ 05:01
    chris
    0

    I use extensionless urls with the server, yes.

  • chris 69 posts 92 karma points
    Dec 24, 2010 @ 08:09
    chris
    0

    I've corrected this problem by using url rewriter 2.0. If anyone's looking for the same, here's the code: 

      <rule name="Non ASPX Redirect" stopProcessing="true">
        <match url=".?htm.?$" />
        <action type="Rewrite" url="/errorpage.aspx" />
        <conditions>
          <add input="{REQUEST_URI}" pattern="^/umbraco/" negate="true" />
          <add input="{REQUEST_URI}" pattern="^/umbraco_client/" negate="true" />
        </conditions>
      </rule>

    you have to add the umbraco* folders, otherwise editing html in the tinymce will redirect you to the error page.

  • Christian Stenfors 80 posts 124 karma points
    Nov 28, 2011 @ 14:13
    Christian Stenfors
    0

    I just used Chris suggestion on a Surftown hosted website (Danish webhosting company), and it worked. Thx a 1.000.000!

Please Sign in or register to post replies

Write your reply to:

Draft