Now, it's fairly easy to just detect these and redirect the user back to the main home page on your primary domain. But what if you have users coming into various sub-pages on the site and want to just transparently rewrite the URL? Well, this is easily done using existing variables in CFWebstore. The file you will want to add your code to is fbx_Settings.cfm. Go to around line 293, just before the clearsession section, and add something like this (add a cfcase for each domain you wish to redirect):
There are certainly other ways to do this, but due to the varying types of URLs that CFWebstore creates according to your store settings, this will work for any store regardless of setup.