Hide Physical Path in IIS HTTP Error

10,322

Solution 1

I had to adjust the tag:

<httpErrors errorMode="DetailedLocalOnly" />

This is inside the "system.webserver" tag. Mine was previously set to "Detailed"

https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httperrors/

Solution 2

You can modify web.config.xml even as far as to creating custom error pages.

<!--  CUSTOM ERROR MESSAGES
      Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
      Add <error> tags for each of the errors you want to handle.

      "On" Always display custom (friendly) messages.
      "Off" Always display detailed ASP.NET error information.
      "RemoteOnly" Display custom (friendly) messages only to users not running
       on the local Web server. This setting is recommended for security purposes, so
       that you do not display application detail information to remote clients.
-->
    <customErrors mode="RemoteOnly"/>

Reference: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/httperrors/

Share:
10,322

Related videos on Youtube

BGS
Author by

BGS

Updated on September 18, 2022

Comments

  • BGS
    BGS almost 2 years

    Is it possible the hide the below physical path from IIS server..?

    When someone try to enter the URL with folder name that time below error raiser in browser :

    For Eg : https://MyDomainAddress/JS

    HTTP Error