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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:09:02+00:00 2026-06-08T18:09:02+00:00

I’m using .net4.5rc with MVC4.0rc The code below is taken from a MVC webapi

  • 0

I’m using .net4.5rc with MVC4.0rc

The code below is taken from a MVC webapi application but I the same behaviour is there for reular asp.net mvc

My registerroutes code looks like this

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

            routes.MapHttpRoute(
                name: "R1",
                routeTemplate: "product/{id}",
                defaults: new { 
                                controller="Product",
                                id = RouteParameter.Optional 

                              }
            );

This works well with Ids that doesn’t have a period in them. However when I ask for a product with a period in it, the call does not seem to get to ASP.NET

when I use the setting below as suggested on similar posts it works when there is a trailing /
But it doesn’t work without it

in summary

http://mysite.com/product/AZ0     //works
http://mysite.com/product/AZ.0/   //work with relaxedUrlToFileSystemMapping
http://mysite.com/product/AZ.0    //does not work

The response is 404 and I guess this is returned by IIS without involving ASP.NET.
When I run routedebugger with a URL like the last one above, I don’t even get the routedebugger stuff

How do I make IIS to pass the control to ASP.NET when there is a URL with a pattern:
mysite.com/product/{id} regardless of whether there is a period in the id or not.

thanks.

  • 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-08T18:09:03+00:00Added an answer on June 8, 2026 at 6:09 pm

    Let me answer this myself. Adding a URL Rewrite solves the problem.
    The code below added to the web.config tells to rewrite the Url with a trailing “/” if the URL is of the form (product/.) Then it is no longer handled as a file but handled as regular MVC.

      <system.webServer>
       ....   
        <rewrite>
          <rules>
            <rule name="Add trailing slash" stopProcessing="true">
              <match url="(product/.*\..*[^/])$" />
              <action type="Rewrite" url="{R:1}/" />
            </rule>
          </rules>
        </rewrite>
      </system.webServer>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.