WordPress permalinks not working because of htaccess conflict?
===

On my hosting account (Linux/Apache) my domain "domain1.com" points to the following directory: /var/www/html, which contains a index.php that shows domain1.com's default website.

I have a second domain "domain2.com" pointing to the IP address of domain1.com. I created a sub folder /var/www/html/domain2.com which contains a WordPress website that can be found via URL http:// domain1.com/domain2.com.

In order to let http:// domain2.com point to the WordPress website I have created the following .htaccess file in /var/www/html:

    Options SymlinksIfOwnerMatch
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www.)?domain2.com$
    RewriteRule ^(.*)$ http://domain1.com/domain2.com/$1  [P]

After this I also changed the website url in WordPress settings and this works fine, my WordPress website can be found via http:// domain2.com.

When I change the permalinks settings in WordPress to use "friendly urls", domain2.com's .htaccess is updated by WordPress to make this possible. However, then the rewrite rule in domain1.com's htaccess doesn't work anymore: When I browse to a domain2.com friendly url, for example http:// domain2.com/about-me, the default website of domain1.com appears.

This is what domain2.com's .htaccess looks like:

    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </IfModule>
    # 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

Because friendly urls are working fine when my WordPress is configured to be openend by http:// domain1.com/domain2.com, I think there is a conflict between the two .htaccess files, but since I am a .htaccess newbie my question is:

How do I change the .htaccess files to make it possible that whatever I put after domain2.com, be it querystring or friendly url, my WordPress website appears and shows the proper page?