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'.


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';

        case 'xyz.com':
                $mageRunCode = 'xyz_base';
                $mageRunType = 'website';

                $mageRunCode = 'base';
                $mageRunType = 'website';


  • 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.


  • 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.

  • The domains used where for reference only as abbreviations. Sorry for any confusion with my description. Thank You!
    – Chad
    Commented Sep 18, 2020 at 4:12
  • This request was intended for M2.3.3 CE. Thank You.
    – Chad
    Commented Sep 18, 2020 at 4:25

1 Answer 1


Sorry it's very huge process so can write it down. Just gave you URL of it.



  • Mayur Sidodiya - Thank you for the quick reply. However, I've browsed this article and it seems to be directed to Commerce Cloud - is there a similar page, that you know of, for CE? **Sorry - I'll go back and edit my article to reflect 2.3.3 CE.
    – Chad
    Commented Sep 18, 2020 at 4:25
  • Let me check and edit this answer. Commented Sep 18, 2020 at 4:30
  • Please check I edit the answer. Commented Sep 18, 2020 at 4:31
  • I've read that article prior - but in the 'Base Link URL' I've always unchecked the box and set that to the domain I'd expect to see. Would that possibly be a cause for my issue? Thank you for the response and your time and your help. Thank You.
    – Chad
    Commented Sep 18, 2020 at 4:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.