Errore HTTP 404.2-not Found "The content requested by IIS 7.5 appears to be a script and therefore cannot be handled by a static file handler

Source: Internet
Author: User

Today, there are some problems with configuring local IIS, the first is a CGI and other errors, after IIS reinstall (most of the functions are ticked) or not, select the IIS Server root, select the ISAPI and CGI restrictions, compared to server IIS, found that only ASP. V2.0, then added a 4.0,windows directory under the Microsoft.net/framework/v4.0.30319/aspnet_isapi.dll, problem solving

The second problem is the direct addition of a default directory is index.aspx, with a URL rewrite, the presence of Errore HTTP 404.2-not Found "The contents of the IIS 7.5 request appears to be a script, so it will not be processed by the static file handlers, and finally, Use the x64 command prompt under VisualStudio tools to Aspnet_regiis-i solution, here's the solution

Title, this error Google when a lot of various solutions, but the specific reasons are not detailed introduction,

404.2 on an HTTP status code, on MSDN, says: 404.2-ISAPI or CGI restriction is a problem with the configuration of "ISAPI or CGI Restrictions" in IIS,

"ISAPI" is a DLL for IIS to load and invoke, and if no related ISAPI is configured, the content of the Web page cannot be interpreted correctly.

The error message that the "requested content appears to be a script and therefore cannot be handled by a static file handler" is thrown, most likely because the page is not configured with the relevant ISAPI, causing IIS to interpret the page as a static file by default, so an error occurs.

For example: Web site developed with net4.0, but ISAPI does not have "Asp.net_4.0_32bit" DLL configured to host the page program, then IIS must not correctly run the C # code in ASPX,

Solution:

1) First confirm that the website is based on that netframework;

2) then go to "application pool" to find the application pool for the site (right-click the advanced settings of the site), double-click the program pool to see if the program pool is also the same version of the Web site's NET Framework,

Note: net2.0,net3.0,net3.5 corresponds to the NET Framework version of v2.0.50727, and net4.0 is based on v4.0.30319

3) Right click on the site corresponding "Application pool and Advanced settings" see "Enable 32-bit application", if the site is compiled with 32 will be set to true, otherwise false, is generally 32 compiled, so are selected as true;

4) If the above configuration is correct, then go to the essential part of the problem, the configuration of the ISAPI:

A. Double-click the ISAPI filter with feature view, Web site

B. To see if there is a DLL corresponding to the framework on which the site is based, net2.0,3.0,3.5 corresponding DLL is asp.net_2.0.50727.0, net4.0 is asp.net_4.0_32bit or asp.net_4.0_64bit;

C. If there is no corresponding DLL, it is possible that IIS is not installed, that is, missing something, if you do not know which parts to choose, it should complete the entire IIS loaded;

5) If the VS reload IIS has to be re-installed to the NET Framework, run CMD, enter:

C:\Windows\Microsoft.NET\Framework\V4.0.30319\aspnet_regiis-i

Note: C:\Windows\Microsoft.NET\Framework\V4.0.30319\ is the corresponding path of netframework installation;

Such as:

6) Restart IIS, in theory should be able to solve the cause of 404.2 not found most of the problem;

Errore HTTP 404.2-not Found "The content requested by IIS 7.5 appears to be a script and therefore cannot be handled by a static file handler

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.