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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:10:28+00:00 2026-05-12T07:10:28+00:00

When looking over the statistics for my site, I realized that the vast majority

  • 0

When looking over the statistics for my site, I realized that the vast majority of traffic is coming via third party links to classic ASP pages which haven’t existing for a few years now.

I decided that adding a bunch of urlMappings to the web.config wasn’t a great idea, so I added Intelligencia UrlRewrite and tried to add a rule, as follows:

  <rewriter>
    <redirect url="^/(.*).asp$" to="~/pagenotfound.aspx?page=$1" />
  </rewriter>

The rule works, but it picks up any url which ends with .asp = such as /pagenotfound.aspx?page=someurl.asp.

Oops 🙂

I’m not exactly knowledgeable about regular expressions, how can I get it to ignore “.asp” which follows the question mark character?

  • 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-12T07:10:28+00:00Added an answer on May 12, 2026 at 7:10 am

    Try this:

      <rewriter>
        <redirect url="^/([^?]*)\.asp(\?.*)?$" to="~/pagenotfound.aspx?page=$1" />
      </rewriter>
    

    That should make it ignore any URL which ends in .asp but contains a ? before it. The [^?] means “any character that’s not a ?” instead of the * which means “any character”.

    Edit: Added extra pattern to allow query strings after a .asp extension but not before them.

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

Sidebar

Related Questions

I'm looking for some good tools/scripts that allow me to generate a few statistics
While looking over various PHP libraries I've noticed that a lot of people choose
I was looking over some code that another developer wrote and found this: Private
I've been looking over the jQuery docs and it indicates that .load is a
While looking over some code, I found a function that seems to do exactly
I was looking over the JavaScript source code for SlickGrid . I've noticed that
From looking over the documentation, it seems that the form clean() method is only
In looking over my Query log, I see an odd pattern that I don't
I'm looking over Apple's sample application EditableDetailView, and noticed that in one of their
I was looking over the StyleGuide for the Arduino when I noticed that in

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.