I'm sorry if this has been asked/answered in a different way of wording it. My apologies.
I have, what seems to be an EXTREMELY simple problem that - no matter how I search it - seems to come up with different solutions. Again, please excuse my ignorance of the solution.
BACKGROUND: The only reason I switched to Magento is because of Multi-Domain support. I currently have a site up that houses over 400,000 SKUs and I want to be able to move those over to one backend and serve different descriptions/prices on each domain. I am hosted currently on Cloudways AWS server and have the DNS pointing to the correct IP addresses as verified by 'whatsmydns.com'.
PROBLEM:
When navigating to 'PCS.COM' I get 'PCS.COM' to appear as 'PCS.COM/DEFAULT' When navigating to 'CRESCOM.COM' I get 'PCS.COM' to appear as 'PCS.COM/DEFAULT' When navigating to 'RRESCOM.COM' I get 'PCS.COM' to appear as 'PCS.COM/DEFAULT'
Id like each domain to point to the correct domain...
I was given instruction from Cloudways that says the following:
1- change the webroot to /pub
2- Fetch the mage run code and mage run type of your stores.
3- Verify the domains in the store-> configurations -> web. Every store should have its own domain, not using the default value.
4- Add the following rules inside the /pub/index.php before $params = $_SERVER;
The code that was provided says:
switch ($_SERVER['HTTP_HOST']) {
case 'abc.com':
$mageRunCode = 'abc_base';
$mageRunType = 'website';
break;
case 'xyz.com':
$mageRunCode = 'xyz_base';
$mageRunType = 'website';
break;
default:
$mageRunCode = 'base';
$mageRunType = 'website';
break;
}
TRIED:
- Updating the pub/index.php file to the recommended settings.
- Setting up all Stores > Config > Web settings to the correct values
- Deleting Server & Reinstalling Magento 2.3.3
- Researching to the fullest extent I can. No matter where I look there are different ways to redirect traffic to the correct domain.
FRUSTRATED: I don't know why/what/how to manage these redirections work. It seems like it should be a simple deal to do but I am at a loss - any help would be appreciated.
ADDITIONAL QUESTIONS:"
- In regards to $mageRunCode - I don't know what code to put in. The Website, Store, or StoreView?
- In regards to $mageRunType - I don't know what code to put in. Store or Store View.....Or Web Site?
FURTHERMORE: I've seen 'solutions' that mention editing the .htaccess file but from my research this would not be optimal because an update to M2 MAY edit that file to make it useless. True?
THANK YOU: I just want to 'Thank You' for you time, assistance, and patience with me with this issue. For you developers out there I have nothing but respect. //// I just don't know (YET) how to do this operation. Thank You..Thank You..Thank You.