Oh, painful. htaccess files are based on physical directories. So no matter what the URL, all requests for /blog/ will pass through the root htaccess, which contains the Magento material.
Does your existing root-level htaccess contain any RewriteRules that aren't directly concerned with the workings of either CMS? Other content doesn't matter, just mod_rewrite. For example, rules ending in the [F] flag for unconditional lockouts. I'm trying to figure out whether you want to set
RewriteOptions inherit
or not. You probably do.
Now, each of your two htaccess files contains a block that looks something like this:
## CMS begins here
<If Module I-forget-the-exact-wording
RewriteEngine on
RewriteRule index.php - [L]
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteCond I-think-there's-one-more-standard-condition
RewriteRule . /index.php [L]
</IfModule>
# end-CMS-stuff
That's from memory, but there's something that looks roughly like that in each htaccess, right?
So in the root htaccess you need a rule
before the Magento package that says
RewriteRule ^blog/ - [L]
meaning "never mind about the /blog/ directory, I'll deal with it later". Right next to this-- still before the Magento rules-- you need a rule that says
RewriteRule ^((page1|page2|page3).+) /blog/$1 [L]
listing all your WP pages or directories
by name.
Do you really have URLs that say /blog/blog/ twice? Is this a legacy of past mistakes, or do you want to keep them? If you want to redirect /blog/blog/blahblah to /blog/blahblah alone, things will get messy. Not impossible, but ugly.
Final crucial question: Have the /blog/ URLs ever been publicly visible, so people-- including search engines-- ask for them by name? If so, you will need another rule-- before all the [L] rules-- that says something like
RewriteCond %{THE_REQUEST} /blog/
RewriteRule ^blog/(.*) http://www.example.com/$1 [R=301,L]
(This is the part where your duplicate /blog/blog/blog/ URLs cause trouble.)
:: dammit, Forums, I never said [ red ] even once, let alone twice. It was the cat ::