How to use .htaccess and mod_rewrite in 1 host-3 domain environment?

insp3kt0r
insp3kt0r used Ask the Experts™
on
I have one hosting account and three domains.

What's the best way to write rules to .htaccess in following situation:

- one account, three domains (domain.cn, domain.fi, domain.com)
- need to redirect these to three subdirs (CN, FI, EN) SO that full path is visible in browser
* (www.)domain.cn redirects /CN/ and shows as http://www.domain.cn/CN/
* (www.)domain.fi redirects /FI/ and shows as http://www.domain.fi/FI/
* (www.)domain.com redirects /COM/ and shows as http://www.domain.com/EN/

I do have a fully working and smooth rules currently which in fact hides those subdirs from browser's address field. However, I want/need them to be visible.

I guess answer is simple, however I'm missing something and can't get it to function like described above.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
RewriteEngine On
RewriteCond %{HTTP_HOST} domain\.cn
RewriteCond %{REQUEST_URI} !^/CN/
RewriteRule ^(.*)$ http://www.domain.cn/CN/$1 [R=301,L]
RewriteCond %{HTTP_HOST} domain\.fi
RewriteCond %{REQUEST_URI} !^/FI/
RewriteRule ^(.*)$ http://www.domain.fi/FI/$1 [R=301,L]
RewriteCond %{HTTP_HOST} domain\.com
RewriteCond %{REQUEST_URI} !^/EN/
RewriteRule ^(.*)$ http://www.domain.com/EN/$1 [R=301,L]

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial