Msg#: 4424210 posted 5:41 pm on Mar 2, 2012 (gmt 0)
I've installed WordPress in a SubDir (/content) and am using pathinfo instead of mod_rewrite to handle pretty URLs (because WP's mod_rewrite borks my site's existing rewrites) and so ordinarily it would be a simple matter of redirecting visitors of my domain to the SubDir.
But several other domains are attached to my site, so I use some code that makes them all go to http://www.mysite.com (i.e. requests for http://www.coosite.com or http://coosite.com would become http://www.mysite.com). This avoids Google's duplication penalty and ensures that "www" is always used (I don't like that but I need it for license reasons).
The code I use for this is simple and clean (hopefully).
Now I can't figure out how to then do a rewrite that directs http://www.mysite.co.uk visitors to wordpress in my /content dir, at least not without breaking the above multi-domain redirect. I tried putting this below and it sent the server slow and crashing.
Msg#: 4424210 posted 6:19 pm on Mar 2, 2012 (gmt 0)
The index redirect can be done with a separate RewriteCond and RewriteRule placed before the canonical ruleset.
In your existing RewriteCond change !^www\.example\.co.uk [NC] (why escape only two of the three periods?) to this new pattern !^(www\.example\.co\.uk)?$ and remove both the [NC] flag and the second RewriteCond.
Some people have suggested to use something like this:
RewriteRule ^(/)?$ content [L]
But ideally when people visit I want them to see the /content under the domain itself and not a URL like [mysite.co.uk...] . But then I'm affraid that forcing that might break existing and or future redirects.. ugh. what a headache :) .