Error 404 with IIS 7.0

I have a text file that I am trying to use in a browser http://files.mydomain.com/test.txtand I get:

HTTP Error 404.0 - Not found 

I double checked and the text file exists. When I add a file test.htm, I have no problem.

Can anyone help? Something tells me about this security issue.

+3
source share
5 answers

You have checked the following:

  • Your DNS "A" record for "files" points to the correct IP address.
  • If your server uses a shared IP address across multiple sites, have you configured the HTTP host header?
  • Is there a mime type for extension .txt?
  • - ? .htm, ASP ISAPI StaticFile?
  • , .jpg, .gif, .pdf ..
+3

, .

, Request Filtering

  • .txt
  • Allow unlisted file name extensions, .

web.config:

<system.webServer>
    <security>
        <requestFiltering>
            <fileExtensions>
                <add fileExtension=".txt" allowed="true" />
            </fileExtensions>
        </requestFiltering>
    </security>
</system.webServer>
+2

, - . 404, , - , - (Sharepoint) 80. , .

+1

MIME-Typ, ...

  • /Mime -type
  • ,
  • ,
  • .txt
  • mime-type "text/plain"

et voila

0

Source: https://habr.com/ru/post/1731303/


All Articles