At the top of your "topic.asp", just after the includes, insert this:
Now, make a custom 404 page for your forum (make sure you tell IIS to use it instead of the default):
It can be something like this - but make sure it includes the parts in RED. The "notopic.asp" page should NOT exist. Now, if a link to a topic is improperly coded and they click the link in the 404 page, it will take them where they should be.