Configure Preferred Domain

Once you have fully set up the desired domain for your sales channel and configured a suitable SSL certificate, you can set up an automatic 301 redirect for your store domain to the exact URL of the sales channel.



Background

When a sales channel is accessed, Shopware 6 distinguishes between the protocols http:// and https://, as well as whether the domain is accessed via www. or without www.. To avoid duplicate content, you should avoid setting up all four cases in Shopware and instead implement a permanent (301) redirect from the web server.



Configure the Preferred Domain

First, log in to the Plesk Control Panel via our Customer Center and navigate to your shop domain.


Next, on the Hosting and DNS tab, select the Hosting menu item.


Under the Preferred Domain setting, select the option you want. Here: www.creoline-demo.com. After you’ve saved the changes, you can use our free HTTP Redirect Tool to verify that the redirects are working properly.



Customize Environment Configuration

To complete the configuration correctly, the environment variable APP_URL must be set to the domain you selected as your preferred one.


Examples

Preferred Domain APP_URL
http://ihre-domain.de http://ihre-domain.de
https://ihre-domain.de https://ihre-domain.de
http://www.ihre-domain.de http://www.ihre-domain.de
https://www.ihre-domain.de https://www.ihre-domain.de