Newly published Web sites on IIS, styles and JS resource files cannot be loaded (resource files and Web pages under the same domain name)

Source: Internet
Author: User

On IIS newly published website, web site can open, but the style with JS resource file is not loaded (resource file and webpage is the same domain name, for example: webpage www.xxx.com/index.aspx, picture www.xxx.com/pic.png).

Then open the resource file separately (for example, the link to open the picture) is, error:

This issue should be a setup issue for the Web. config configuration file.

In the

"*"Path="*.gif"Type="System.Web.DefaultHttpHandler"/> <add verb="*"Path="*.jpg"Type="System.Web.DefaultHttpHandler"/> <add verb="*"Path="*.png"Type="System.Web.DefaultHttpHandler"/> <add verb="*"Path="*.ico"Type="System.Web.DefaultHttpHandler"/> <add verb="*"Path="*.css"Type="System.Web.DefaultHttpHandler"/> <add verb="*"Path="*.js"Type="System.Web.DefaultHttpHandler"/> 

The corresponding type value should be changed to "System.Web.StaticFileHandler" value, as follows:

"*"Path="*.gif"Type="System.Web.StaticFileHandler"/> <add verb="*"Path="*.jpg"Type="System.Web.StaticFileHandler"/> <add verb="*"Path="*.png"Type="System.Web.StaticFileHandler"/> <add verb="*"Path="*.ico"Type="System.Web.StaticFileHandler"/> <add verb="*"Path="*.css"Type="System.Web.StaticFileHandler"/> <add verb="*"Path="*.js"Type="System.Web.StaticFileHandler"/> 

The path to accessing the resource file at this time should be OK.

Newly published Web sites on IIS, styles and JS resource files cannot be loaded (resource files and Web pages under the same domain name)

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.