0

I found a few different question here that explain how to make sure CSS loads properly without the user being logged in: CSS not being applied on non authenticated ASP.NET page.

Why does this problem only happen in the development environment, and not in production? If the problem is that web.config says that non-authenticated users cannot access the css files, then why does it work fine in production? It seems that in web.config should prevent that access in both production and development.

2
  • 1
    I bet something else is wrong. It should function the same way in production. It could be a caching issue. Commented Feb 14, 2013 at 16:14
  • The login page definitely looks good in production though, even though I've confirmed that the web.config there doesn't have the authentication exclusion for css and images folders, which I just added locally to fix the issue in development. Commented Feb 14, 2013 at 16:16

1 Answer 1

3

The answer is simple.

In your dev environment this is the asp.net engine which serves all the content, static and dynamic. Thus, authorization rules apply to both.

In your prod, iis routes dynamic requests to asp.net page handler but requests to static content is handled by iis. Thus, authorization does not apply as the asp.net is not involved in requests to jpgs, csses and other static assets.

If you want a uniform semantics between environments, you'd have to turn on running all managed modules for all requests, this is a setting of your asp.net web application. It routes all requests via asp.net which causes the engine to apply all modules (including the url authorization module) for all requests.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.