Company is hosting two websites I will call them companyA and companyB. companyB website is rarely used but I notice when it calls a php program it is actually grabbing the companyA version of the php program instead of its own. I assume there is a problem with the configuration of the virtual hosts specifically the rewriterule(s) but I am not finding it.

Below I have pasted the configuration sections that I think is causing the problem. Any help or pointers would be great. This is running on an AS400.

<VirtualHost *:80>
ProxyPreserveHost On
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} ^.+\.php$ [NC]
RewriteRule ^/(.*) http://127.0.0.1:8000/$1 [P]
ProxyPassReverse / http://127.0.0.1:8000/
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
ServerName www.companya.com
DirectoryIndex index.htm
DocumentRoot /www/webserver/websites/coma
ServerAlias companya.com *.companya.com
UserDir public_html
<Directory /www/webserver/websites/coma>
Order Allow,Deny
Allow From all
</Directory>
<Directory /qsys.lib/netdata.lib>
Allow From all
Order allow,deny
Options +ExecCGI
</Directory>
ScriptAlias /cgi-bin/db2www/ /qsys.lib/netdata.lib/db2www.pgm/
Alias /ifs/ /www/webserver/websites/coma/

</VirtualHost>
<VirtualHost *:80>
ProxyPreserveHost On
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} ^.+\.php$ [NC]
RewriteRule ^/(.*) http://127.0.0.1:8000/$1 [P]
ProxyPassReverse / http://127.0.0.1:8000/
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
ServerName www.companyb.com
DirectoryIndex Welcome.htm
DocumentRoot /www/webserver/websites/comb
ServerAlias companyb.com *.companyb.com
UserDir public_html
<Directory /www/webserver/websites/comb>
Order Allow,Deny
Allow From all
</Directory>
<Directory /qsys.lib/combdata.lib>
Allow From all
Order allow,deny
Options +ExecCGI
</Directory>
ScriptAlias /cgi-bin/db2www/ /qsys.lib/combdata.lib/db2www.pgm/
Alias /ifs/ /www/webserver/websites/comb/


</VirtualHost>