Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4065544
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:59:45+00:00 2026-05-20T15:59:45+00:00

I’m running a Sitefinity CMS website on IIS 7. I’m seeing a couple of

  • 0

I’m running a Sitefinity CMS website on IIS 7. I’m seeing a couple of weird results when I’m trying to return a 404 status.

If I go to a URL like:

http://www.mysitefinitywebsite.com/test.co.uk (I realise this is an invalid address, but someone entered it into the CMS)

As the above is not an ASPX page, I believe IIS handles the error, with the following code:

    <httpErrors errorMode="Custom">
        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" prefixLanguageFilePath="" path="/404.aspx" responseMode="ExecuteURL" />
    </httpErrors>

The url in the address bar remains the same, my custom 404 page (/404.aspx) page is displayed, however a http status code 200 is returned.

If however the following url is typed in:

http://www.mysitefinitywebsite.com/test.aspx – the ASPX error handler kicks in with the following config:

<customErrors mode="On" >
    <error redirect="~/Sitefinity/nopermissions.aspx" statusCode="403" />
    <error redirect="~/404.aspx" statusCode="404" />
</customErrors>

Again, my custom 404 page is displayed, however the url in the address bar changes to:

http://www.mysitefinitywebsite.com/404.aspx?aspxerrorpath=/test.aspx

And strangely if I check Firebug, a 302 code is returned for text.aspx and then a status of 200 for /404.aspx?aspxerrorpath=/test.aspx.

I don’t completely understand whats going on here, it seems like IIS isnt responding with the status code at all – is this by design? Seems completely crazy!

If it is by design, presumably the only way to resolve it is to programatically return the correct response code?

Thanks in advance
higgsy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:59:46+00:00Added an answer on May 20, 2026 at 3:59 pm

    When you use the <httpErrors> element and using executeUrl, you are serving dynamic content. If that content doesn’t explcitly return the status code (an asp.net, asp, etc page) you need to set the existingResponse attribute to auto/replace/passthrough as you see fit.

    The intent here is the web server can have a generic error and you may want to return a different or extended error code to your clients. This makes more sense for APIs where you might want a 404 to contain/return more info about what wasn’t found, etc, etc.

    Take a look at the IIS.NET documentation on httpErrors for the existingResponse flag

    http://www.iis.net/ConfigReference/system.webServer/httpErrors


    As for ASP.NET, a 302 redirect on error is default behavior, which is what you see. The 404 is returned b/c the page you are redirecting to is programmatically setting the status code of the response.

    The difference is simply causing by handling. In the first you are allowing IIS to handle the error before executing the ASP.NET pipe. In the second, IIS passes off to the ASP.NET pipeline. They are two different techs, hence the two difference behaviors. Rest assured with a little research you can make them both do the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.