I am converting a DotNetNuke/aspx site to a WordPress/php site on a different ISP.

The domain name will be the same.

Currently on Google there are about 5 links for .aspx pages that I'd like to redirect to their new WP home


  • any "old" URL containing "/?id=43" should go to "/page-one"
  • any "old" URL containing "/?id=21" should go to "/page-two"
  • any "old" URL containing "/?id=67" should go to "/page-three"
  • any "old" URL containing "/?id=03" should go to "/page-four"
  • any "old" URL containing "/?id=59" should go to "/page-five"
  • any other incoming but now invalid URL should just default to the home page


Note that there are a few Google links beside the main 5 that refer to pages that have no direct new counterpart - hence the last item in the above list.

Besides doing these 6 redirects/rewrites the .htaccess should have the usual "good practice" stuff in it, including

  • change non-www prefix to www
  • add trailing slashes where appropriate


...and here is the .htaccess code that was generated for the new WP site:

Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
MY PLEA FOR HELP

Starting with the Wordpress-generated code, I have spent hours trying to get all these conditions to work in a single .htaccess file. I don't want to move the site yet until I get a working .htaccess file coded, so in the meantime I have been using the online tool at "htaccess.madewithlove.be" which seems very useful but I cannot find the right combo.

Heck, at this point I'm not even sure if I should be trying Rewrites or Redirects. And should I explicitly account for WP's "index.php" in that some users might use it explicitly and others may not?

Can anyone point to an .htaccess example that would have all four of these elements:
1) the above-listed rewrites/redirects
2) www prefixes forced
3) use the above Wordpress generated code
4) default to home page for any stray "old" incoming URLs?