1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Forcing a domain name in the URL displayed in the browser address bar
This guide explains how to force the display of the hosting name in the browser address bar to point to one of the alias domain names or how to display the main domain in the address bar instead of the alias.
Limiting "duplicate content"
Let's suppose that your-domain.com is hosted by us and you have installed www.aliasdomain.xyz as an alias domain name.
By default, when you type either of these domain names (your-domain.com or aliasdomain.xyz) into your browser address bar, the address that you type is the one that will appear in the address bar.
You thus have the option of forcing an address other than that typed in to be displayed.
Hence, if somebody types aliasdomain.xyz, your-domain.xyz is the address that will be automatically displayed in the address bar.
Some code must be placed in a file named .htaccess, which in turn must be located in the root of your hosting (in the /web folder of your FTP space).
If the file does not yet exist, you must create it on the server.
RewriteRule ^(.*)$ https://your-domain.com/$1 [R=301,L]
Replace "your-domain.xyz" with your domain name with the appropriate extension (.com, .fr, .ch, etc.) that you wish to see displayed in the address bar of the visitor's browser. Add www. before your-domain.com if necessary.
Also read about automatic redirecting to https: https://faq.infomaniak.com/1961