Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I successfully use a similar setup which I migrated from IIS 6 to IIS 7. My web.config has the following section;</p> <blockquote> <pre><code>&lt;system.webServer&gt; &lt;httpErrors errorMode="Custom"&gt; &lt;remove statusCode="500" subStatusCode="-1" /&gt; &lt;remove statusCode="404" subStatusCode="-1" /&gt; &lt;error statusCode="404" prefixLanguageFilePath="" path="/302page.asp" responseMode="ExecuteURL" /&gt; &lt;error statusCode="500" prefixLanguageFilePath="" path="/500page.asp" responseMode="ExecuteURL" /&gt; &lt;error statusCode="500" subStatusCode="100" path="/500page.asp" responseMode="ExecuteURL" /&gt; &lt;/httpErrors&gt; &lt;system.webServer&gt; </code></pre> </blockquote> <p>I configured this on the relevant site via IIS Manager but you could do it via web.config file if easier for you.</p> <p>You can add conditional header depending on whether should be 301, 302 or 404.</p> <p>404;</p> <pre><code>Response.Status = "404 Not Found" Response.AddHeader "Location", pagename </code></pre> <p>302 (temporary re-direct);</p> <pre><code>Response.Status="301 Object Moved" Response.AddHeader "Location", pagename </code></pre> <p>301 (permanent re-direct);</p> <pre><code>Response.Status="301 Moved Permanently" Response.AddHeader "Location", pagename </code></pre> <p>IIS site's application pool uses Integrated pipeline-mode. And attached are settings for debugging section for site.</p> <p><img src="https://i.stack.imgur.com/6YzFf.jpg" alt="settings for debugging section for site"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload