This question is a little more DevOps-related, and touches on the Business Practitioner side. This is another very relevant, practical question, and should be included in your pre-launch checklist for a new website or store. Some situations, like this one, have multiple options for how to solve them, but it’s important to work through the options and identify pros and cons of each before implementing a solution.
For domain-level redirects, Joseph recommends using web server redirects whenever possible. Using Magento’s Store Configuration to Auto-Redirect Base Url with the 301 redirect is an option, but it is not the fastest. The Magento application would have to spool up, read the store configuration, and has to understand what’s its domain name is. This would take some time and would not be the fastest approach. Cloudflare, Fastly, or web server redirects are the best options for quickly getting a domain level redirect set.
Let us know what you think about this week’s question and answer, and you might be invited to be a guest on the Smash The Bug Podcast!
Connect with Joseph:
Have you joined the free SwiftOtter Slack community? It’s exploding and we don’t want you to miss out. Go to https://swiftotter.com/slack to join for free and get plugged into what might be the best group of collaborating developers around!