Web Hosting & Ecommerce Puerto Rico

 


 

  Preguntas y Respuestas 




MAY 19

 How can I set custom 404's for ASP/.NET?

  Colocado por Webmaster PRMWD on May 19, 2010 4:14 PM as Hosting a site in PRMWD




How can I set custom 404's for ASP/.NET?

 

Custom 404's can be set for ASP and .NET sites by adding the below code to the bottom of the web.config file before the final </configuration>. You will need both options to redirect all 404's.


Classic ASP and Static Content

<configuration>
  <system.webServer>
         <httpErrors errorMode="DetailedLocalOnly" defaultPath="/404.asp" defaultResponseMode="ExecuteURL">
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" />
         </httpErrors>
  </system.webServer>
</configuration>

.NET

<configuration>
  <system.web>
    <customErrors defaultRedirect="404.aspx" mode="DetailedLocalOnly">
      <error statusCode="404" redirect="404.aspx"/>
    </customErrors>
  </system.web>
</configuration>


This exampled shows 404's for all content redirecting to index.html:

<configuration>
  <system.webServer>
         <httpErrors errorMode="DetailedLocalOnly" defaultPath="/index.html" defaultResponseMode="ExecuteURL">
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="/index.html" responseMode="ExecuteURL" />
         </httpErrors>
  </system.webServer>
     <system.web>
                 <customErrors mode="On">
                     <error statusCode="404" redirect="/index.html" />
                </customErrors>
     </system.web>
</configuration>

comentario (0)




1 - 1 of 1

Colocado por

Nombre*

Email*

Comentario*

Verification code*

Comentarios










 


Temas Recientes


 Instalar el certificado SSL en servidor 

 Generate a CSR 

 Prerequistos de Instalacion SSL 

 Quiero denuciarlo me robo mi dominio 

 Tips para que no caiga de tonto 


Temas


 Dominio (3)

 Hosting a site in PRMWD (18)

 MS SQL (4)

 php (1)

 RedHat (1)

 Servcio Garantia Servidores PRMWD (2)

 Servers (5)

 Servers for Windows (2)

  SSL (Certificados Seguridad) (4)


Buscador




Archivo


 august 2010

 july 2010

 may 2010

 february 2010

 january 2010





admin*