1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Redirect visitor (domain, Web page, etc.)
This guide explains how to redirect a domain name directly to another or how to automatically send visitors from your website to another page address (internal or external URL).
You will need to take action either on the domain name itself (it must be hosted by Infomaniak, and its DNS must also be those of Infomaniak), or on the code present in your pages (htaccess page, homepage, etc.) if you have a website.
⚠️ For additional help, contact a partner or submit a request for proposal — also read the role of the host
Acting on the Domain Name
via Web Redirection Tool
The tool available in the Manager allows you to easily act on the domain name (or subdomain) to redirect it to the Internet address of your choice.
via DNS changes or A record
Change the DNS of the domain name or modify its A/AAAA records to direct web traffic to another provider.
Acting on the Code of the Pages
via HTML code to insert
Insert this line of code between the <head>
and </head>
tags of your homepage (usually named index.html):
<meta http-equiv="refresh" content="5;url=INSERT-HERE-NEW-URL">
Replace 5 with the desired waiting time in seconds (0 for an immediate effect).
Google search engine suggests using a server-side 301 redirect (see below). The W3C also advises against using it.
via PHP code to insert
If the site page has a .php extension, insert this function call at the top of the file:
header("refresh: 5; url=INSERT-HERE-NEW-PAGE-URL");
via .htaccess file
To redirect all traffic to your site (regardless of the called page) to another address, insert this in the .htaccess file at the root of your site:
RewriteEngine On
RewriteRule ^(.*)$ INSERT-HERE-NEW-URL/$1 [R=301]
To target the page that needs to be redirected:
Redirect permanent /old_page.html insert destination URL here
Redirectpermanent, Redirect permanent, and Redirect 301 are equivalent commands.
Here is another example of redirecting a subpart to the homepage (this directive works with "deep links" unlike a permanent redirect):
RewriteEngine on
RewriteRule "old/path/url "/" [L]