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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:25:42+00:00 2026-05-27T18:25:42+00:00

I am converting an existing classic ASP website to (VB) MVC and I don’t

  • 0

I am converting an existing classic ASP website to (VB) MVC and I don’t want any of the existing URLs to break. I have read many posts (like this one: Routing Classic ASP Requests To .NET – SEO Redirects) about how to do the proper 301 redirect. With the latest MVC release, I’ve gathered that

Response.RedirectPermanent(objRedirect.new_url, True)

is all that is needed.

I have entered all of my old URLs in a database table with a corresponding column of the new URL. I have added code in my custom 404 page to get the original URL:

Dim strURL As String = Request.RawUrl.Substring(Request.RawUrl.IndexOf("aspxerrorpath=") + 15).ToLower()

so I can look it up in the database. (Interesting sidenote, MSDN’s documentation here – Redirect Mode – seems to say that if I set RedirectMode=ResponseRewrite in the CustomErrors section of my web.config, I won’t have to worry about doing the above, but when I’ve tried that, I get IIS errors saying it won’t serve an ASP page?!?!?)

The problem I am encountering is that any of my old, Classic ASP URLs that have the same directory as a new MVC route are somehow being partially routed. For example, “/test/default.asp” shows up as “/test/test” in the above strURL variable of my error page.

I do have a route setup for “test”:

routes.MapRoute("Test", _
                "test/{action}", _
                New With {.controller = "test", .action = "index"})

in Global.aspx.vb, but I also have tried every conceivable way to ignore all ASP pages in routes (seemingly to no avail). Here are the attempts I’ve made (I did see one old – 2008 – post by Phil Haack that said I could only have one of these “catch all” ignore routes, but don’t know if that’s still valid or not?):

routes.IgnoreRoute("{file}.asp")
routes.Ignore("{resource}.asp/{*pathInfo}")
routes.IgnoreRoute("{resource}.asp/{*pathInfo}")
routes.Add(New Route("{resource}.asp/{*pathInfo}", New StopRoutingHandler()))

and none of them seemed to make any difference (I tried them all one at a time obviously).

This isn’t isolated to just one route either – it occurs for any directories that existed on the old site that match a named route on the new site.

Thanks in advance for any and all suggestions you have!

UPDATE: Here are 2 more “issues” I’ve discovered:

  1. I am loosing the original querystring. So, if product.asp?id=1 is requested, all I have in the error page is product.asp (any idea how to get at/save the original querystring?)
  2. Another one of my routes looks like this:

    routes.MapRoute(“IndependentSales”, _
    “independentsales/{action}”, _
    New With {.controller = “independentsales”, .action = “index”})

and when I request “/resale/default.asp”, it goes to “resale/independentsales”. WHAT is up with that???

  • 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-27T18:25:43+00:00Added an answer on May 27, 2026 at 6:25 pm

    OK, after hours and hours of reading/researching/debugging, I came to the conclusion that I wasn’t doing anything wrong and that there was something “buggy” in Visual Studio, .NET, MVC … something! And I was right! I created a new project from scratch, copied all my code over there and everything worked as it should!

    (Well, I’m not sure “as it should” is correct, but I did get my code to function the way I wanted. Requests for ASP pages still hit the MvcApplication_BeginRequest – which I don’t think they should with my IgnoreRoute entries???? – but at least the extension was still there when it got there, so I could look-up the ASP page in my database and do the redirect!)

    So, this may have been unique to me, but maybe I can save others hours of frustration … if you think you have everything correct, maybe you do! Create a new project and try that!

    … It sucks to be a programmer! ;-D

    (Musings … The 3 things that I didn’t add back into my new project were:

    1. the logging tool ELMAH
    2. the RouteMagic DLL
    3. and the RouteDebugger.dll.

    I may try subtracting them from my original project and see how that goes. Given the popularity of ELMAH and who wrote the route ones, I can’t imagine that there would be a problem with them, but who knows …?)

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

Sidebar

Related Questions

Have just started converting an existing job tracking system into an ASP.NET MVC application.
I have an existing ASP.NET web application that I'm converting to MVC 1.0. The
I am converting an existing ASP.NET website to use jQuery Mobile controls. The first
I'm converting an existing ASP.NET app to MVC2, and I have an existing method
I am converting a classic ASP website to .NET. The application already has a
I've been tasked with converting an existing ASP.NET site from using InProc session management
I have a string that I'm converting to a float that I want to
I have an existing web application that I am converting to use CakePHP. The
I'm slowly converting my existing code into Delphi 2010 and read several of the
I am researching the feasability of converting an existing asp.net web forms project to

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.