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

  • SEARCH
  • Home
  • 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 8021679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:03:21+00:00 2026-06-04T22:03:21+00:00

When I request the following URL from my MVC application I constantly get redirected

  • 0

When I request the following URL from my MVC application I constantly get redirected to the HomeController.

http://www.mymvcapp.com/?m=standardvalue&a=someothervalue&code=12345

Now I’m trying to overcome this by edditing the Global.asax.cs request routes, e.g.

routes.IgnoreRoute(".*m=standardvalue.*");

So what I expect as a result is whenever the URL contains “m=standardvalue” it won’t take me to the HomeController. It could be I’m doing this totally wrong, someone that can point me in the good direction for solving my problem.

Additional info:
The link doesn’t look anything like MVC, thats because Apllication Request Routing (IIS7) catches this URL and translates it to a webserver running PHP.

  • 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-04T22:03:22+00:00Added an answer on June 4, 2026 at 10:03 pm

    What you need here is a route constraint. The constraint will return true if the requested URL has no target controller and contains a query string with a variable m that equals standardvalue.

    public class DefaultWithoutParamsConstraint : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext,
                          Route route,
                          string parameterName,
                          RouteValueDictionary values,
                          RouteDirection routeDirection)
        {
            return values[parameterName] == null &&
                   httpContext.Request.QueryString["m"] == "standardvalue";
        }
    }
    

    Now just add this constraint to your ignore list:

    routes.IgnoreRoute(
        "{*controller}",
        new { controller = new DefaultWithoutParamsConstraint() }
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to request data from an ASP.net MVC application. I'm
I'm using .NET MVC 2 If an incoming request contains the URL: http://something.com/1234 where
I have the following code to perform a GET request on the following URL:
I got the following request from an Android developer : Would you change the
I have the following on a page: @{ Session[CurrentUrl] = Request.Url.ToString(); } I then
Im sending a simple url request using the following url: urlString = [NSString stringWithFormat:
I need to get the very last word from an URL. So for example
I have an ASP.NET MVC web application running from http://localhost/myappname . From jQuery, I
With databinder-dispatch 0.8.3 I'm trying to get the redirect url from a 302 http
I have an MVC 3 application that works fine when running locally from visual

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.