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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:44:31+00:00 2026-05-20T18:44:31+00:00

We are rewriting an old site for a client, from Classic ASP to ASP.NET

  • 0

We are rewriting an old site for a client, from Classic ASP to ASP.NET 4. The new site will be living at the same root URL as the old one once it is pushed live.

One stipulation though is this… the old site used to use a page such as article.asp?articleid=### to load content. The new site will be using something similar, but making use of ASP.NET Routing such as ~/articles/o/### (the ‘o’ is for ‘old id’).

I need to be able to catch requests to the old article.asp page and rewrite the url to the new article.aspx url.

My original thought was to handle this in the Application_BeginRequest. I remapped the .ASP extension to be handled by the same handler dll as .ASPX pages, and then added the following code to my Application_BeginRequest in my global.asax:

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
    Dim ctx = HttpContext.Current, url = ctx.Request.RawUrl
    If Regex.IsMatch(url, "/article\.asp\?articleid=\d+") Then
        Dim oldid = Regex.Match(url, "(?:articleid=)(\d+)").Groups(1).Value
        Server.Transfer("~/articles/o/" & oldid)
    End If
End Sub

This did not work though. As this is right now, I need to have an actual article.asp in the path or else I get a 404 error (and even then it doesn’t actually do anything, and just displays a blank page). This would work fine (assuming redirect code in the ASP page worked), except that they had 500 copies of article.asp each in their own sub-directory (breaking the whole point of a CMS model). They want to preserve the old urls in case someone clicks an old one from an email or bookmark.

I need to be able to map this file name to the new path, irregardless of the sub-directory it was in, as per the logic in my Application_BeginRequest above. What would be the proper way to do this? As global.asax isn’t working, I’m assuming I need to either write an HttpHandler or HttpModule class, but I’m not sure which is the right way to go.

Running IIS on Windows Server 2003 R2.

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-05-20T18:44:32+00:00Added an answer on May 20, 2026 at 6:44 pm

    Putting my above code in the Application_BeginRequest method of global.asax actually WAS a right place. The problem was one more missing setting in IIS. In the dialog where you remap .ASP to the ASP.NET handler, you also need to make sure to turn off the option for Verify that file exists. This completed the procedure, and my old pages now map to the corresponding new pages.

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

Sidebar

Related Questions

No related questions found

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.