Copied to clipboard

Flag this post as spam?

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


  • Lee 1130 posts 3088 karma points
    Mar 31, 2010 @ 16:38
    Lee
    0

    IIS7 & 404?

    I'm guessing this must be a setting in IIS, but I have several sites running with custom 404 pages on IIS6 and all I did was put the nodeID in the <error404>1264</error404> section in the umbracoSettings.config

    But I have done this on a new site in IIS7 but it doesn't work, I get the default IIS 404 page?  Am I missing something?

  • Bas Schouten 135 posts 233 karma points
    Mar 31, 2010 @ 16:47
    Bas Schouten
    0

    Hi Lee,

    When you are in the settings of the error pages just right click on the 404 page and select Edit feature settings. There you can select `custom error pages` and it should work.

    Cheers,

     

    Bas

  • Lee 1130 posts 3088 karma points
    Mar 31, 2010 @ 16:57
    Lee
    0

    Hi - Sorry I'm not following you, are you saying I do have to go into IIS and change settings?

  • Bas Schouten 135 posts 233 karma points
    Mar 31, 2010 @ 17:02
    Bas Schouten
    0

    Hi,

    Yes, it is a setting in IIS. Can I have your E-mail adress so i can send you some screenshots?

    Bas

  • Donald St. Martin 83 posts 128 karma points
    Mar 31, 2010 @ 17:42
    Donald St. Martin
    4

    Lee,

    I had this same problem.  I followed the instructions on http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=24786 and was able to get it to work.

    Basically, you need to add

    <location path="Site Description">
    <system.webServer>
    <httpErrors existingResponse="PassThrough" />
    </system.webServer>
    </location>

    to your applicationHost.config file where "Site Description" is the name of your site in IIS7.

    Hope this helps.

    --
    Donald

  • Dennis Milandt 190 posts 517 karma points
    May 06, 2010 @ 22:17
    Dennis Milandt
    0

    Thank you Donald,

    I had the same problem :-)

    Cheers
    /Dennis

  • Christian Palm 278 posts 273 karma points
    Nov 25, 2010 @ 11:57
    Christian Palm
    8

    I had the same problem on a shared host.

    You can also insert in web.config under <system.server>

    <httpErrors existingResponse="PassThrough" />

    No need to change applicationHost.config file

  • Mark Mitchell 35 posts 60 karma points
    Mar 23, 2011 @ 00:28
    Mark Mitchell
    2

    Thanks for the tip Christian.

    I added

    <httpErrors existingResponse="PassThrough" />

    as the last entry in the <system.webServer> section (not system.server) and it worked great!

    Thanks!
    Mark

  • Jason 5 posts 25 karma points
    Mar 31, 2011 @ 19:13
    Jason
    0

    I just stumbled onto this issue as well, and doing the steps above solves my issue ... almost.

    it works for the following:  

    it does NOT work for:
    Does anyone know what to do to make the static content redirect properly as well?
    Thanks!

     

  • jc 64 posts 101 karma points
    Mar 31, 2011 @ 19:26
    jc
    0

    This works for me on both aspx and static file 404 errors:

    <httpErrors errorMode="Custom" existingResponse="Replace">
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" prefixLanguageFilePath="" path="/404.aspx" responseMode="ExecuteURL" />
    </httpErrors>
  • Sandor 13 posts 36 karma points
    May 24, 2011 @ 08:13
    Sandor
    0

    Hi jc,

    Visually your solution works, but there are 2 down-sides to it:

    1. The original url is replaced by the url to the 404 page. No biggy, but it's nicer to show the visitor the actual url that does not exist.

    2. More problematic is the underlying status code that you are returning. In this solution you get the visual 404, but if you check in e.g. FireBug you will see that it actually returns a 302 redirect which in turn gives the 404 page with a status code 200 OK. This is ok for ordniary vistiors but bots and google do not process redirects and scripts and will probably interprete the non existing page as existing but with a temporary new location.

    So, unfortunately I am still looking for a 'true' solution.

    Does anybody know why with pass-through mode I get a blank page for static files?

    Is there a way to break into that process and make it redirect elsewhere?

    Sandor

  • jc 64 posts 101 karma points
    May 24, 2011 @ 17:06
    jc
    0

    Sandor,

    1. The original error that caused the 404 is not replaced by the error to the 404 page
    2. The underlying status code returned is 404, not 302 (see below for results in Firebug and Live HTTP Headers)

     

  • Sandor 13 posts 36 karma points
    May 24, 2011 @ 17:08
    Sandor
    0

    Hi jc,

     

    You are very right. I noticed it later on when testing it again. I think I'd playing around with the error settings for too long and sort off lost track on what was and was not working. Thanks for replying though, makes be extra sure about the current implmentation.

    S

  • Mike Chambers 636 posts 1253 karma points c-trib
    May 03, 2012 @ 13:51
    Mike Chambers
    0

    Hi guys... I've stumbled upon this during me trying to solve the same issue... On windows server 2088 with iis7 I'm getting the respose.status = 200! I can see that you are on iis7.5 from the screen grab... any suggestions?

    So rather than rely on the web.config to sort my 404, I tried to get the umbraco handle404 or a custom 404handler to sort my .htm not found files.

    Starting point was

    {modules runAllManagedModulesForAllRequests="true"}

    and

    {httpErrors existingResponse="PassThrough"/}

    then

    {configuration}
    {system.webServer}
    {handlers}
    {remove name="PageHandlerFactory-Integrated" /}
    {add name="PageHandlerFactory-Integrated" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" /}
    {add name="PageHandlerFactory-Integrated-htm" path="*.htm" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" /}
    {add name="PageHandlerFactory-Integrated-html" path="*.html" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" /}
    
            {/handlers}
    {/system.webServer}
    { /configuration}
    You also need register a build provider for .htm and .html extensions.
    {system.web}
    {compilation}
    {buildProviders}
    {add extension=".htm" type="System.Web.Compilation.PageBuildProvider" /}
    {add extension=".html" type="System.Web.Compilation.PageBuildProvider" /}
    
    {/buildProviders}
    {/compilation}
    {/system.web}

    That gets me as far as stopping iis handling htm as StaticFile handler mapping...

    However, even though now I get the asp.net server errror, for the 404 not found .htm file I still can;t get umbraco to handle it via the managed Handler...

    Any gurus out there who can point me in the direction of an alternative to type="System.Web.UI.PageHandlerFactory" so that it gets passed to the correct umbraco handler... everything I've tried doesn't implement the IHttpHandler :-(

  • Victor 10 posts 61 karma points
    Oct 21, 2013 @ 13:59
    Victor
    0

    Hi,

    I have followed what is written here and updated the following:

    in umbracoSettings.config I have:

        <errors>
          <!-- the id of the page that should be shown if the page is not found -->
          <!--<error404>
                       <errorPage culture="default">1</errorPage>
                       <errorPage culture="en-US">200</errorPage>
                </error404>-->
          <error404>11550</error404>
        </errors>

     

    in Web.config I got:

      <system.webServer>

       <httpErrors existingResponse="PassThrough"/>
      </system.webServer>

     

    I anticipated that with these simple settings, my 404 would be set.

    this DOES work for http://www.myDomainName.com/random_chars_what_so_ever,

    but DOES NOT work for this scenario:

    if I have this valid url: http://www.myDomainName.com/5592/CountriesHotels/

    but request this: http://www.myDomainName.com/5592/CountriesHotels/random_chars_what_so_ever

    I get an ugly 404 page which is not the one I set and defined in the configs.

    further more if I request an image file that does not exist like this: http://www.myDomainName.com/5592/CountriesHotels/bogus_image_file.gif

    I get an error message on my page, saying that the image cannot be displayed because it contains errors.

    I anticipated for my defined 404 page.

    is there some thing that I have neglected in the configuration?

     

    I'm using Umbraco 6.1.2 and my defaultRenderingEngine is set to MVC

     

    vic.

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft