CSS file Access 403 blocked access after MVC release: Access denied issue

Source: Internet
Author: User

Recently used MVC to do a project problem, using Debug=true to generate browsing without problems, access to all normal;

But with Debug=false released, open the site normal, but no style, check the code found that there is a CSS file is not downloaded;

Post-post CSS links are like this

<link href= "/content/css?v=v8chmyqvlf5eyjvwkqmmv6yejw7lvy0_eslyrg" rel= "stylesheet" >

The browser opens this path (/CONTENT/CSS?V=V8CHMYQVLF5EYJVWKQMMV6YEJW7LVY0_ESLYRG) with 403 blocked access: Access is denied; then the path to the browser will find that the path automatically adds a "/" Behind the CSS. , that is, to become such a/content/css/?v=v8chmyqvlf5eyjvwkqmmv6yejw7lvy0_eslyrg (note the Red "/"); The browser is looking for the CSS folder instead of the CSS file before the translation, and direct access to the real CSS link (real link:/content/site.css) can be opened normally. Why so, see the other CSS normal, only this is a problem.

Solve:

content Folder There is indeed a CSS folder, the CSS folder deleted and then released, solve the problem;



Other related code

The binding code is like this

Bundles. ADD (New Stylebundle ("~/content/css"). Include ("~/content/site.css"));
Generated CSS So
/content/css?v=v8chmyqvlf5eyjvwkqmmv6yejw7lvy0_eslyrg
Actual path

/content/site.css




Related Article

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.