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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:48:49+00:00 2026-05-10T17:48:49+00:00

I am probably overlooking something really simple here but I am trying to redirect

  • 0

I am probably overlooking something really simple here but I am trying to redirect all bad URLs to an action that filters the URL based on conditions and then either 301 redirects to a suitable page or issues a 404 page.

To this end I have a route like this at the end of my route table:

routes.MapRoute('Error', '{*url}', new { controller = 'Main', action = 'Error' });  

And an action like this:

public ActionResult Error(string url) {         if (/* Conditions are met... */)         {             Response.Status = '301 Moved Permanently';             Response.AddHeader('Location', /* Destination URL */);             Response.End();         }          Response.StatusCode = 404;         return View(/* 404 page... */)); } 

This works perfectly locally.

However, when deployed to IIS6, URLs that don’t include .mvc (e.g. oldfile.php) are never sent to the ASP.NET process for routing.

Is there a simple solution / am I overlooking something?

EDIT : This is related to this question, however under IIS6 URLs without .mvc are not being sent for ASP.NET MVC processing.

  • 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. 2026-05-10T17:48:50+00:00Added an answer on May 10, 2026 at 5:48 pm

    More than likely when you deployed to the Server, ASP.Net is not being invoked.

    I would setup wildcard mapping in IIS so your requests will use ASP.Net to serve the requests.

    Open IIS manager, right-click your app, go to Properties, then Home Directory tab, then click Configuration. Under Wildcard application maps, click Insert (not Add, which is confusingly just above), then enter C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll for “Executable”, and uncheck Verify that file exists.

    For more information please visit the source that helped me with this issue at: http://blog.codeville.net/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/

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

Sidebar

Ask A Question

Stats

  • Questions 245k
  • Answers 245k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I've seen one major advancement in QuickCheck 2, I think… May 13, 2026 at 8:11 am
  • Editorial Team
    Editorial Team added an answer It will no doubt be an alignment issue. On many… May 13, 2026 at 8:11 am
  • Editorial Team
    Editorial Team added an answer let us remember that asp.net renames your controls for you.… May 13, 2026 at 8:11 am

Related Questions

I've been doing some reading about two (relatively) new concepts in the Javascript language
I ran into an issue with something that I am probably just overlooking. I
So I have an 'export' application that arrives the user at an end page
I am implementing a simple license-file system, and would like to know if there

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.