There is a better way to do this now. Take a look at this post that describes it. This page is kept here for all that have already installed this solution.
Original Solution – Outdated Now
This has been tested with WordPress 1.5 and 2.0
• WordPress 1.5 or 2.0
• Ability to change your 404 error page with your web host.
This solution requires two files: errorpage.asp and htaccess.txt or htaccess.php.
1. Log into the admin section of WordPress.
2. Click on Options -> Permalinks
3. Set your Permalink Structure to “Custom” and enter in a pattern for your permalinks. WordPress has a section that gives all of the permalink structure tags. Mine is currently set to:
Category Base: /archives/category
4. Click Update Permalink Structure
5. Upload htaccess.php and errorpage.asp into the root directory of your blog.
6. The steps used for this next step will vary depending on your hosting provider. Essentially, what you want to do is set a custom 404 redirect to “/errorpage.asp”. It is important that the type of redirect is set to URL. (There are several options.
You can change this directly from within IIS by selecting Properties -> Custom Errors. Select 404. Edit. Set Message Type to URL (you have the option of File, URL or Default). Set it to /errorpage.asp
7. Your done! Try it out. If it doesn’t work, post a comment on my blog and I’ll attempt to help you out.
The script is now dynamic, meaning it uses htaccess.php to figure out what your permalink rules are. htaccess.php gets the rules directly from WordPress. Previous versions required you to copy/paste the rules from WordPress into htaccess.txt. This feature is still available for those that want to modify the rules from the standard that wordpress puts out.
To do this:
Get the rules either by accessing htaccess.php in a browser and then copying the source, or by navigating to the permalinks section in WordPress’ admin area.
Paste the rules directly into htaccess.txt.
Change this line in ErrorPage.asp.
Dynamic = True
Change it to:
Dynamic = False