1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Force a Domain Name in the URL Displayed by the Web Browser
This guide explains how to force the display of the web hosting name in the browser's address bar to one of the installed alias/synonym domain names or how to display the main domain in the address bar instead of the alias.
Limit "duplicate content"
Assuming you have the hosting your-domain.com
with Infomaniak and that as a synonym domain you have installed www.synonymdomain.xyz
.
By default, when you type either of the domain names (your-domain.com
or synonymdomain.xyz
) in your browser's address bar, the one you typed will be displayed in the address bar.
You have the option to force the display of an address other than the one that was typed.
So if someone types synonymdomain.xyz
, your-domain.com
will automatically be displayed in the address bar.
A code is to be entered in a file called .htaccess
that must be located at the root of your hosting (in the /web
folder of your FTP).
If this file does not yet exist, you need to create it on the server.
Then insert these directives into the file:
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://your-domain.com/$1 [R=301,L]
Adjust the code above according to these instructions:
- replace
your-domain.com
with your domain name with the appropriate extension (.com, .fr, .ch, etc.) that you want to display in the visitor's browser address bar. Addwww.
before your-domain.com if necessary. - replace the second line of the above code with "
RewriteCond %{HTTPS} off
" if a loop error occurs, this means that HTTP/2 is active for this site
Also read the automatic redirection to httpS.