Git Product home page Git Product logo

Comments (9)

christian-walker avatar christian-walker commented on May 26, 2024 1

@davidalger looks like I needed to run composer dump-autoload after adding the new stores.php file to it. All good now! Thanks!

from warden.

davidalger avatar davidalger commented on May 26, 2024

@christian-walker Are you making those changes in index.php or pub/index.php? Warden uses pub/index.php as the application entry point on M2 environments. What I would recommend is taking a look at the information here:

The above links show how to handle multi-site setups, and the 2nd one demonstrates how to setup store codes by domain for use on local (without impacting prod, stage, etc).

from warden.

christian-walker avatar christian-walker commented on May 26, 2024

Thanks @davidalger I'll take a look.

from warden.

christian-walker avatar christian-walker commented on May 26, 2024

@davidalger if I use willhen2.test, do I add it like this in the .env TRAEFIK_HOST_LIST=app.willhen.test,willhen2.test or is it like this:
TRAEFIK_HOST_LIST=app.willhen.test,app.willhen2.test

from warden.

christian-walker avatar christian-walker commented on May 26, 2024

@davidalger also for subdomains like this b2b.willhen.test, would I still have to add app at the beginning in the browser or would it just be https://b2b.willhen.test

from warden.

davidalger avatar davidalger commented on May 26, 2024

@christian-walker The domains can really be whatever you want them to be, no need for app to be there. That's merely the default.

When you set the label traefik.frontend.rule: Host:${TRAEFIK_HOST_LIST} in the project override file, that label replaces the default one, so whatever you specify there will be routed exactly as you specify it, no magic applied. So you would want TRAEFIK_HOST_LIST=app.willhen.test,app.willhen2.test in the .env file to use app sub-domain on the two different domains. If you're wanting to use b2b as the sub-domain, just specify that in the host list instead.

As a general rule, for my own projects here at Mediotype, I actually tend to not use the app sub-domain and do something like site1.client.test and site2.client.test. Use what works best for you.

from warden.

christian-walker avatar christian-walker commented on May 26, 2024

@davidalger thanks, that makes sense. So for my second store I set it up with subdomain b2b.willhen.test like this:

https://share.getcloudapp.com/jkunnLv5
https://share.getcloudapp.com/WnuEEYpb
https://share.getcloudapp.com/bLuGGAvg

But its still forwarding to the first site b2c.willhen.test

from warden.

christian-walker avatar christian-walker commented on May 26, 2024

@davidalger I've added the stores.php file and ran composer dump-autoload after running setup:di:compile and setup:upgrade and the site is still forwarding to the main site. Do you have any other suggestions?

from warden.

davidalger avatar davidalger commented on May 26, 2024

@christian-walker Afraid not. Don't recall ever encountering an issue in which Magento redirects to the wrong store/website when the codes are properly set and passing to the application in $_SERVER as environment variables. Use of the stores.php file has worked quite reliably for me. I'd see what you can do to see why composer is not loading it (although if it's configured as outlined in the referenced links above, I'm at a loss on that one as well)

from warden.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.