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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:33:57+00:00 2026-06-01T23:33:57+00:00

The following route will match any folder structure below BasePath: http://BasePath/{*SomeFolders}/ How do I

  • 0

The following route will match any folder structure below BasePath:

http://BasePath/{*SomeFolders}/ 

How do I create another route which will match any zip file below the same BasePath structure?

I tried this…

http://BasePath/{*SomeFolders}/{ZipFile}

… but it errors with

A path segment that contains more than one section, such as a literal section or a parameter, cannot contain a catch-all parameter.
Parameter name: routeUrl

How should I approach this?

*Update*

The original requirements are in fact flawed.
{ZipFile} will match the final section regardless of what it contains. (File or Folder)

In reality I believe the route pattern I’m looking to match should be:

http://BasePath/{*SomeFolders}/{ZipFile}.zip
  • 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-06-01T23:34:00+00:00Added an answer on June 1, 2026 at 11:34 pm

    Catch all anywhere in the URL – exactly what you need

    I’ve written such Route class that allows you to do exactly what you describe. It allows you to put catch-all segment as the first one in the route definition (or anywhere else actually). It will allow you to define your route as:

    "BasePath/{*SomeFolders}/{ZipFile}"
    

    The whole thing is described into great detail on my blog post where you will find the code to this Route class.

    Additional info

    Based on added info I would still rather use the first route definition that doesn’t exclude file extension out of the route segment parameter but rather add constraint for the last segment to be

    "[a-zA-Z0-9_]+\.zip"
    

    So routing should still be defined as stated above in my answer, but contraint for the ZipFile should be defined as previously written. This would make my special route work out of the box as it is now.

    To also make it work for other route delimiters (like dot in your example) code should be changed considerably, but if you know routing very well how it works, you can change it to work that way.

    But I’d rather suggest you keep it simple and add a constraint.

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

Sidebar

Related Questions

I have a route like following, ideally I would like it to match: domain.com/layout/1-slug-is-the-name-of-the-page
I have the following URl: http://localhost:12981/BaseEvent/EventOverview/12?type=Film This is route: routes.MapRoute( Default, // Route name
I'm trying to define a route configuration which will allow an optional 'region' in
I need to match this route in my ASP MVC application: http://localhost/<itemName>/details When the
Hi all i've got the following code which will go off and get all
I have a url which will take the following form: /AuditReview/Review/15d49a66-5c11-492c-921f-9e1700bd2618 I cannot get
I have the following route: {language}/{controller}.mvc/{action}/{id} Once a user has choosen the language it
I have the following route: routes.MapRoute( Default, // Route name {controller}/{action}/{id}, // URL with
I've defined the following route for a simple blog. routes.MapRoute( Blog, blog/{year}/{month}/{day}, new {
I cannot get the following route to fire when a url is requested from

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.