Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1090669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:24:30+00:00 2026-05-16T23:24:30+00:00

Consider a StaticResourceController that locates and serves files. I’ve set up an explicit route

  • 0

Consider a StaticResourceController that locates and serves files.

I’ve set up an explicit route for “favicon.ico” that will handle the request for this file using StaticResourceController:

routes.MapRoute(
        "favicon",
        "favicon.ico",
        new { controller = "StaticResource", action = "Get", file = "favicon.ico", area="root"},
        new[] { "Dimebrain.Mvc.Controllers" }
        );

In IIS6 the expected result occurs when making a request for http://localhost:8080/favicon.ico.

Unfortunately when I deploy to IIS7 http://localhost/favicon.ico returns an IIS-generated 404, presumably because it’s actually looking for the favicon.ico in the web root folder, where it doesn’t exist.

I have enough happening in StaticResourceController that this isn’t a good thing for my application, especially since it is multi-tenant and the favicon.ico file can change. I’ve set my web server modules to handle every request and override the RouteCollection to disregard file checks with RouteExistingFiles.

Why is the UrlRoutingModule getting in my way in IIS7 and forcing serving the static file from disk (404)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:24:31+00:00Added an answer on May 16, 2026 at 11:24 pm

    In case anyone else runs into this problem, the solution is you need you to let MVC know not to process requests in folders where your actual static files live:

    // Make sure MVC is handling every request for static files
    routes.RouteExistingFiles = true;
    
    // Don't process routes where actual static resources live
    routes.IgnoreRoute("content/{*pathInfo}");
    routes.IgnoreRoute("scripts/{*pathInfo}");
    routes.IgnoreRoute("areas/admin/content/{*pathInfo}");
    routes.IgnoreRoute("areas/admin/scripts/{*pathInfo}");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this in C#: int[] a = new int[1024]; All integers will be set
Consider the following set up: - SomeFilter extends Filter - Filter implements Runnable -
Consider an ASP.NET Web API service that redirects public class ThisController : ApiController {
Consider that we are given an isometric grid (consider something like Diablo) of tiles.
Consider an article inside a div that has many <p> tag. Is there any
Consider this scenario. We have an internal Rails 2 app that connects to a
Consider the following function . This will be called everytime the browser is resized
Consider the following function that implements non-blocking access to only the one thread. public
Consider that I have a complex class structure where many elements inherit from other
Consider a table invoice_data containing data about invoices over 12 years. This data will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.