所有RewriteCond域都经过第二个默认的RewriteRule

UPDATE: All RewriteCond domains go through the second default RewriteRule, instead of going to their own RewriteCond, then RewriteRule. All URL's that I go to default to the /template/home.php. I know you can put in multiple domains in a single .htaccess, but I have not been able to get this .htaccess to direct different domains to their default paths. This has left me scratching my head.

Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} (.[^\.]+)(.+)(firstDomain)(\..+) [NC]
RewriteRule .* - [E=SLUG:%1,E=DOMAIN:%{HTTP_HOST}]
RewriteRule ^/?$ /template/home.php [NC,L,QSA]

RewriteCond %{HTTP_HOST} (.[^\.]+)\.on\.(secondDomain)(\..+) [NC]
RewriteRule .* - [E=SLUG:%1,E=DOMAIN:%{HTTP_HOST}]
RewriteRule ^/?$ /template/landing.php [NC,L,QSA]

What happends when you negate the first condition like this :

Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} (.[^\.]+)(.+)(firstDomain)(\..+) !^www.secondDomain.com$ [NC] 
RewriteRule ^/?$ /template/home.php [NC,L,QSA]

RewriteCond %{HTTP_HOST} (.[^\.]+)\.on\.(secondDomain)(\..+) !^www.firstDomain.com$  [NC]
RewriteRule ^/?$ /template/landing.php [NC,L,QSA]

RewriteCond is applicable to very next RewriteRule only. So you will need to have:

Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} (.[^\.]+)(.+)(firstDomain)(\..+) [NC]
RewriteRule ^ - [E=SLUG:%1,E=DOMAIN:%{HTTP_HOST}]

RewriteCond %{HTTP_HOST} firstDomain\. [NC]
RewriteRule ^/?$ template/home.php [L]

RewriteCond %{HTTP_HOST} (.[^\.]+)\.on\.(secondDomain)(\..+) [NC]
RewriteRule ^ - [E=SLUG:%1,E=DOMAIN:%{HTTP_HOST}]

RewriteCond %{HTTP_HOST} secondDomain\. [NC]
RewriteRule ^/?$ template/landing.php [L]