Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: (untagged)
my website hosted on windows server. when status code 302 occurs its showing server information like Server:- Microsoft-IIS/8.0 but not in 404 500. i have developed application in asp.net C#
suppose my url is http://164.100.158.189/SHRCtest/Secure/login.aspx
but if i typed
http://164.100.158.189/SHRCtest/Secure/logi then 302 response come with server information

how to solve it.

What I have tried:

i have tried in

void Application_PreSendRequestHeaders(object sender, EventArgs e)
   {
       Response.Headers.Remove("Server");
       Response.Headers.Remove("X-AspNet-Version");

   }



<httpProtocol>
         <customHeaders>
             <add name="X-Frame-Options" value="SAMEORIGIN" />
             <add name="X-XSS-Protection" value="1; mode=block" />
             <add name="X-Content-Type-Options" value="nosniff" />
             <add name="Strict-Transport-Security" value="max-age=31536000; includeSubDomains" />
             <remove name="X-Powered-By" />


         </customHeaders>
     </httpProtocol>


<httpErrors>
           <remove statusCode="404" subStatusCode="-1" />
           <error statusCode="404" prefixLanguageFilePath="" path="http://localhost/eaudit/error.aspx" responseMode="Redirect" />
       </httpErrors>
Posted
Comments
Bryian Tan 31-Oct-18 7:36am    
did you verify if http://localhost/eaudit/error.aspx is working?
MadMyche 31-Oct-18 10:59am    
The version at the IP address throws a 500
MadMyche 31-Oct-18 10:57am    
Did you look notice that the 302 is sending you to http://164.100.158.189/SHRCtest/404.aspx? I would look at setting up an Application_Error block in your global.asax file. If this was MVC I could better help you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900