I am working on a Magento 2.2.7 running on Apache/Linux/Cloudways. Before I started working here, three websites were already setup to run on a single magento instance. Microbattery.com , HearingAidBatteryShop.com, and cochlearbatteries.com. I am now trying to add a third site using the magento backend. I created the website, store and storeview for hearing-aid-batteries.com and its pointed to our servers. I modified the rewrites in the .htaccess file of my magento directory but hearing-aid-batteries.com is redirecting to microbattery.com for some reason.
I have tried the following: php bin/magento cache:clean
php bin/magento cache:flush
rm -rf var/cache/*
php bin/magento reindexer:index
I checked the tmp director to see if any cache files were being stored in there.
I changed the base url for hearing-aid-batteries.com to http://hearing-aid-batteries.com
All of these things still result in the same issue.
hearing-aid-batteries.com redirects to microbattery.com
.htaccess and sitemap config
SetEnvIf Host wwww\.hearing-aid-batteries\.com MAGE_RUN_CODE=habaffiliate
SetEnvIf Host staging\.hearing-aid-batteries\.com MAGE_RUN_CODE=habaffiliate
SetEnvIf Host www\.hearing-aid-batteries\.com MAGE_RUN_TYPE=website
setEnvIf Host staging.\hearing-aid-batteries\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^hearing-aid-batteries\.com MAGE_RUN_CODE=habaffiliate
SetEnvIf Host ^hearing-aid-batteries\.com MAGE_RUN_TYPE=website
RewriteCond %{HTTP_HOST} ^.*hearing-aid-batteries\.com$
RewriteRule ^sitemap.xml$ /aff/sitemap.xml [NC,L,R=301]
RewriteCond %{HTTP_HOST} ^hearing-aid-batteries.com [NC]
RewriteRule ^(.*)$ https://www.hearing-aid-batteries.com/$1 [L,R=301,NC]