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 3693474
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:22:54+00:00 2026-05-19T04:22:54+00:00

How do I configure an IgnoreRoute to ignore all files with a certain extension,

  • 0

How do I configure an IgnoreRoute to ignore all files with a certain extension, regardless of what directory they’re in?

If I do this, everything works and my Flash movie gets played:

routes.Ignore("community/123/plan/456/video/moviename.flv");

So the “123” and “456” sections are variable and can be any integer number. Obviously though, I don’t want to do one of these for each movie NOR do I have a need to replace 123 and 456 with variable placeholders. This is only an example of one type of directory, there are Flash movies stored throughout the application so what I need is an IgnoreRoute value that will ignore files that have a .flv extension no matter where in the hierarchy they are.

I’ve tried the following:

routes.IgnoreRoute("{file}.flv");
routes.IgnoreRoute("(.*).flv(.*)"); // Yeah I know, I'm horrible at RegEx

The only thing I can get to work so far is specifically passing the full relative path to the FLV file. Any suggestions?

  • 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-19T04:22:55+00:00Added an answer on May 19, 2026 at 4:22 am

    Check this article by Phil Haack: http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx

    Long story short, we didn’t want routing to attempt to route requests
    for static files such as images. Unfortunately, this caused us a
    headache when we remembered that many features of ASP.NET make
    requests for .axd files which do not exist on disk.

    To fix this, we included a new extension method on RouteCollection,
    IgnoreRoute, that creates a Route mapped to the StopRoutingHandler
    route handler (class that implements IRouteHandler). Effectively, any
    request that matches an “ignore route” will be ignored by routing and
    normal ASP.NET handling will occur based on existing http handler
    mappings.

    Hence in our default template, you’ll notice we have the following
    route defined.

    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    

    This handles the standard .axd requests.

    ……..

    We only allow one catch-all route and it must happen at the end of the
    URL. However, you can take the following approach. In this example, I
    added the following two routes.

    routes.IgnoreRoute("{*allaspx}", new {allaspx=@".*\.aspx(/.*)?"});
    routes.IgnoreRoute("{*favicon}", new {favicon=@"(.*/)?favicon.ico(/.*)?"}); 
    

    What I’m doing here is a
    technique Eilon showed me which is to map all URLs to these routes,
    but then restrict which routes to ignore via the constraints
    dictionary. So in this case, these routes will match (and thus ignore)
    all requests for favicon.ico (no matter which directory) as well as
    requests for a .aspx file. Since we told routing to ignore these
    requests, normal ASP.NET processing of these requests will occur.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to configure Django to serve static files when using runserver (production works
Configure Command is Go to Glib Directory -> run this command ./configure --prefix=Installation directory
Although configure -platform win32-msvc2005 -arch x86 works well, nmake is immediately giving a fatal
./configure --enable-avfilter --enable-filter=movie --enable-gpl --enable-postproc \ --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis \ --enable-libtheora --enable-libdirac --enable-libschroedinger
I would like to configure logger for certain class to write to separate file.
problem description: This model works fine with one user at a time. As soon
Is it possible to configure nHibernate to connect to Paradox database ( *.db files)?
I have my routes configured like this in my global.asax routes.IgnoreRoute({resource}.axd/{*pathInfo}); routes.MapRoute( poems-by-profile, //
I configure ssl on jetty. I am using this code: import org.mortbay.jetty.security.SslSocketConnector; . .
running the configure script for mozart oz gives me this: checking for stdint.h... (cached)

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.