Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
This guide explains how to redirect all visitors to a secure HTTPS (SSL) version of a site on Infomaniak Web Hosting.
This redirection is usually automatic with standard configuration and installation ⚠️ For additional help contact a partner or submit a request for proposal — also read the role of the hosting provider
Prerequisites
- Have a valid and functional SSL certificate for the Infomaniak website
Manual Redirection via .htaccess File
Simply modify or add the following 3 lines to the .htaccess file of the relevant website to ensure that all visitors are automatically directed to its secure HTTPS version:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://domain.xyz/$1 [R=301,L]
If Problems Arise
- Replace the second line of the code above with
RewriteCond %{HTTP:X-Forwarded-Proto} !https
With a CMS
Most web applications like WordPress and Joomla have extensions/plugins that automatically redirect site visitors to its secure HTTPS version.
WordPress
If you are using a content management system (CMS) like WordPress to build your site, we recommend installing an extension to handle this redirection:
- Back up the site's files and database as a precaution
- Install the Really Simple SSL extension or similar from the WordPress console and activate it
- Visitors will now be automatically redirected to the HTTPS version of the site
- If issues persist (after clearing cache, etc.), you may also use Velvet Blues Update URLs
Joomla
Find the line
var $live_site ='';
in the Joomla configuration file (configuration.php) on the server
Replace with
var $live_site = 'https://www.domain.xyz';
Add three lines to your .htaccess file on the server:
RewriteEngine On RewriteCond %{HTTPS} OFF RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
- Open the Joomla administration panel in "System - Configuration"
- Click on the "Server" tab and under "Force SSL" select "Administration and site"
- Save and visitors will now be automatically redirected to the HTTPS version of the site
Prestashop
- Go to the general settings in the Prestashop back-office to enable SSL:
- < v1.7 click on "Preferences" then "General"
- > v1.7 click on "Shop Parameters" then "General"
- Toggle the "Enable SSL" button to "YES"
- Click on "Save"
- In the same place, toggle the "Enable SSL on all pages" button to "YES"
- Click on "Save"
If a security lock does not appear in the browser or a warning is displayed, check the template or modules as sometimes they may not be fully compatible with SSL. Your Prestashop might be loading elements (images, .css or .js files, fonts...) over "http" when they should now be loaded over "https".
Drupal
This article (in English) explains how to switch a Drupal site from http to https.
Alternative Solutions
Replace domain.xyz with your domain name and the appropriate extension (.com, .fr, .ch, etc.)
In your .htaccess file, to force the site URL to be https:// but without www :
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteRule (.*) https://domain.xyz/$1 [R=301,L]
In the case of a redirection loop, adjust the code above to:
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
RewriteCond %{HTTP_HOST} ^www. [NC]
RewriteRule (.*) https://domain.xyz/$1 [R=301,L]
In your .htaccess file, to force redirection with www
with subdomains:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule (.*) https://www.domain.xyz/$1 [R=301,L]
In the case of a redirection loop, adjust the code above to:
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule (.*) https://www.domain.xyz/$1 [R=301,L]
and without subdomains:
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^domain.xyz [NC]
RewriteRule (.*) https://www.domain.xyz/$1 [R=301,L]
In the case of a redirection loop, adjust the code above to:
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
RewriteCond %{HTTP_HOST} ^domain.xyz [NC]
RewriteRule (.*) https://www.domain.xyz/$1 [R=301,L]
Common Errors with HTTPS Redirection
To resolve common issues that may arise from redirecting your website to its secure HTTPS version, consult this guide (click here).
This guide concerns inbound and outbound traffic permissions between different hosting providers at the database level.
Accessing...
... external databases to Infomaniak
From an Infomaniak Web hosting, it is possible to perform MySQL queries to external servers without restriction.
... from outside to Infomaniak databases
Access to Infomaniak databases from outside the infrastructure is only allowed with a Cloud Server (you need to open port 3306
in TCP / inbound in the firewall).
Allowing external connections on MongoDB
Regarding MongoDB, you need to disable the "local_only" option from Fast Installer:
- Log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Edge
- Click on the icon at the top right of the interface (or navigate through the left sidebar menu for example)
- Choose Cloud Server (universe Web & Domain)
- Click on the name of the object concerned in the displayed table
- Click on Fast Installer in the left sidebar menu
- Click on MongoDB
- Click on the action menu â‹® to the right of the object concerned in the displayed table
- Click on Configure
- Disable "local_only"
- Save the changes
Port 27017
for MongoDB must be opened in the firewall.
This guide explains how to activate or deactivate maintenance mode on a website hosted by Infomaniak Hosting.
Maintenance mode allows you to display a customized message to your visitors, for example, during the resolution of a technical issue. It is also possible to configure IP addresses that can bypass this page.
Activating Maintenance Mode
To set up a page with your chosen message:
- Log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Edge
- Click on the ‍ icon at the top right of the interface (or navigate through the left side menu, for example)
- Choose Website (universe Web & Domain)
- Click on the name of the relevant object in the displayed table
Then choose:
- A/B: click on Manage then Enable Maintenance
- C: click on Enable Maintenance then Customize
- D: click on Page Editor then Maintenance Page > Customize
Then, to customize the maintenance page:
- Layout the text as desired
- Configure the display using the elements on the right
- Click Save to keep your ongoing edits
- Click Save & Activate to publish the page
Allowing IP Addresses
It is possible to display a site even with maintenance mode active. To do this, it is necessary to specify the IP addresses of computers that should be able to bypass maintenance mode:
- Activate maintenance mode following the procedure above
- Go to the maintenance page configuration page (see above procedure)
- Under Maintenance on the right, click on Insert my IP address to allow your computer to display the site without maintenance mode. It is also possible to manually enter the IP addresses to allow
- Click Save and Publish
Deactivating Maintenance Mode
To deactivate the message displayed on your site during maintenance:
- Log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Edge
- Click on the ‍ icon at the top right of the interface (or navigate through the left side menu, for example)
- Choose Website (universe Web & Domain)
- Click on the name of the relevant object in the displayed table
- Click on Manage then Disable Maintenance or directly on the button in the red banner
Alternative Method for WordPress
It is not recommended to activate the above Infomaniak maintenance page and then work in WordPress. It is recommended to install a WordPress extension (there are dozens available) dedicated to putting WordPress into maintenance mode within the CMS itself or by adding the code
<?php $upgrading = time(); ?>
in a new empty file named .maintenance (the period before the file name is important) placed on the server at the root of your site, which disables all your pages except the WordPress home page.
This guide allows you to create subdomains with web hosting, including Cloud Server. However, this function is not possible with Starter hosting (the 10 MB hosting included with each domain name).
Subdomains make it easier to organize hosting. For example, the address vlog.domain.xyz is a shortcut for the address domain.xyz/vlog. In other words, the address vlog.domain.xyz points to the vlog folder located at the root of the website domain.xyz. In this example, vlog is the subdomain of domain.xyz.
Step 1: Add the Subdomain as an Alias for Your Website
- Follow the alias adding procedure but please read points 2 and 3 below carefully
- In the Alias domain name field, enter the complete subdomain address (e.g., vlog.domain.xyz)
- If your domain or its DNS zone is managed by Infomaniak, enable the following two options: Update DNS entries for this domain and Replace existing entries. If not, create an A record with your registrar with the following information:
- Field: the complete URL of the subdomain (e.g., vlog.domain.xyz)
- Target: the IPv4 address (A record) of your site (how to display your site's A record)
Step 2: Modify the htaccess File of Your Website
Important: The following instructions are provided for reference only. You may need to adapt the code to make it work in your situation.
Using your FTP software or our FTP Manager, add and adapt the following code to the htaccess file located at the root of your website:
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.xyz [NC]
RewriteCond %{DOCUMENT_ROOT}/%1/ -d
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/?
RewriteRule "^(.*)$" "%{DOCUMENT_ROOT}/%1/$1" [L]
Explanation for the third line: https://stackoverflow.com/a/15981056
Replace on the first line:
- domain with your domain name
- xyz with the extension of your domain (ch, fr, etc.)
Now, the address vlog.domain.xyz should display the content of the vlog folder located at the root of your website. If it doesn't, check if the vlog folder exists at the root of your website.
This guide explains how to add or modify one or more A and AAAA records in the DNS zone (of a domain) managed on Infomaniak's Manager.
Type A and AAAA
This type of record allows you to point a domain name to a static IP address (typically a server), with A for IPv4 and AAAA for IPv6.
This is the method commonly used to redirect your domain name to the IP address of the web server hosting your website. In fact, we automatically use this type of pointing to link your domain name to your website if they are in the same place and under the same customer account.
You should only modify this type of record in cases where you have a specific configuration to set up (e.g., pointing a subdomain to an external application).
Editing the DNS Zone
Refer to this guide (click here) to learn how to manage records in a DNS zone.
This guide can help you identify and fix most 404 errors or white page, website not displaying, when you type your site's address in the browser's address bar and it's impossible to reach the hosting.
⚠️ For additional help contact a partner or submit a request for proposal — also read the hosting provider's role
What to Check First
At your level, it's highly recommended to:
- check your Internet connection: visit a site like https://www.ch.ch or https://www.microsoft.com. If these addresses are not visible through your browser then you need to contact your ISP (Internet Service Provider) as the issue is with your Internet connection.
- clear your Internet browser cache to refresh the page that seems not to be displaying and maybe it will then become visible. Learn more
- check if your website is visible to others. For this, ask acquaintances outside your network to test access to your site on the Internet or use the following site: https://downforeveryoneorjustme.com. It will tell you in English if the site is down (out of service) only for you, or for everyone.
- use a proxy to connect to your website from another location in the world
- check that it's not the domain name that has expired. Be careful to make the distinction between the domain name and the hosting because these two entities are most often distinct from each other. In summary, you can have a fully functional hosting with Infomaniak (to make sure, log in to the Manager) and a domain name that has expired (due to non-payment of invoice for example). Check the status of your domain name by doing a whois and contact the registrar of your domain name if necessary.
- consult your script/CMS configuration file if you have one to check the login information (database name and address - username and password). Learn more
If a Problem Persists...
You need to contact Infomaniak support in writing with the following information:
- name of the hosted site
- your public IP address at the time of testing (visible here https://www.infomaniak.com/ip)
This guide explains how to modify the server configuration of a site on Infomaniak Web Hosting.
.htaccess or .user.ini file?
Apache is the HTTP server. It is configured with a .htaccess
file placed at the root of the website.
PHP is a programming language used to create dynamic web pages via an HTTP server. PHP directives can be customized with a .user.ini
file, which will be effective in the folder and subfolders where the .user.ini
file is located.
Modify the server configuration of a site
via the Manager
To modify the PHP configuration and most parameters (max_input_vars
, allow_url_fopen
, memory_limit
, post_max_size + upload_max_filesize
, etc.):
- log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser such as Brave or Firefox
- click on the ‍ icon in the top right corner of the interface (or navigate using the left side menu, for example)
- choose Website (in the Web & Domain universe)
- click on the name of the relevant object in the displayed table
- click on the Advanced settings button
- click on the PHP or Apache tab to make the desired adjustments
via the .user.ini file
For PHP directives that are not available in the Manager, it is necessary to define the desired values in the .user.ini
file, for example:
max_file_uploads = 20
The list of existing directives is available on the official PHP website, but items marked as PHP_INI_SYSTEM
in the Modifiable
column, as well as max_input_time
, memory_limit
, and mysqli.default_socket
, cannot be used.
via CLI
To customize PHP directives when running command-line scripts (CLI) or in CRON tasks, it is necessary to specify the desired values in a .user.ini file. Then, to apply these configurations, the PHP executable with the -c option followed by the path to the .user.ini file is used. For example, to change the available memory limit for PHP to 1024M, you can create or edit the .user.ini file using the following command:
echo 'memory_limit = 1024M' > .user.ini
This command writes the memory_limit directive with the value 1024M to the .user.ini file. Then, when running a PHP script on the command line or in a CRON task, the PHP command with the -c
option is used to specify the .user.ini file containing the customized configurations.
The following example enables allow_url_fopen
for the WP CLI tool (allows retrieving extensions):
php -d allow_url_fopen=On ~/bin/wp package install trepmal/wp-revisions-cli
php
: the PHP executable-d allow_url_fopen=On
: the-d
option is used to set a PHP configuration directive (allow_url_fopen
) with the valueOn
~/bin/wp
: path to the WP CLI executablepackage install trepmal/wp-revisions-cli
: the specific command to install the WP CLI packagetrepmal/wp-revisions-cli
This ensures that the allow_url_fopen
option is enabled during the execution of the specified WP CLI command. Enabling allow_url_fopen
may be necessary for certain operations involving opening remote URLs, such as downloading extensions or packages. Make sure this option is enabled securely and following security best practices.
While Infomaniak offers all the SSL certificates you may need:
- Let's Encrypt certificates for personal sites: install a Let's Encrypt certificate (only possible for sites hosted with Infomaniak)
- DV (Domain Validation) certificates from Sectigo for professional/personal sites that are not registered as businesses, and EV (Extended Validation) certificates from Sectigo for registered businesses: order an EV or DV certificate from Sectigo, the world's leading certificate authority (compare these SSL certificates: prices, guarantees, included services, etc.)
You can also install an SSL certificate obtained elsewhere (intermediate certificate from a certification authority of your choice), custom certificates, or self-signed certificates.
This guide explains how to generate a CSR (Certificate Signing Request). This is an encrypted block of text that uniquely identifies who you are and which domain name you want to protect with the certificate.
1. Install a self-signed or custom SSL certificate
To access website management:
- Log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Firefox
- Click on the icon in the top right corner of the interface (or navigate using the left sidebar menu, for example)
- Select Website (Web & Domain universe)
- Click on the name of the relevant object in the displayed table
- Click on SSL Certificates in the left sidebar menu
- Click the blue Install an SSL certificate button
- Re-select the relevant site at the top of the page, if necessary
- Select I already have an SSL certificate at the bottom of the page
- Click Next
At this stage, your site's traffic is encrypted, but visitors to your site will see a very discouraging security warning upon their first visit. To avoid this, we strongly recommend installing a free Let's Encrypt SSL certificate or a professional Sectigo SSL certificate. Compare SSL certificates
2. Generate a Certificate Signing Request (CSR)
To access website management:
- Log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Firefox
- Click on the icon in the top right corner of the interface (or navigate using the left sidebar menu, for example)
- Select Website (Web & Domain universe)
- Click on the name of the relevant object in the displayed table
- Click on SSL Certificates in the left sidebar menu
- Click on the name of the site that currently has a self-signed certificate
- Click on Manage
- Click on Generate a certificate request (CSR)
This page allows you to generate a file that must be submitted to a recognized certification authority to obtain a signed certificate.
Once the page is completed with your information and validated (by clicking on Generate Request), click on the button to Download the .csr file and submit it to the certification authority of your choice to obtain the signed certificate, which you can then import to the same location (read below).
You can also proceed by copying and pasting if you prefer, using the corresponding option. The certificate obtained via this CSR will be valid only for this hosting.
3. Import a certificate / intermediate certificate
To access website management:
- Log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Firefox
- Click on the icon in the top right corner of the interface (or navigate using the left sidebar menu, for example)
- Select Website (Web & Domain universe)
- Click on the name of the relevant object in the displayed table
- Click on SSL Certificates in the left sidebar menu
- Click on the name of the site that currently has a self-signed certificate
- Click on Manage
- Click on Import a certificate or Import an intermediate certificate and follow the instructions to select the .crt file and import it; you can also proceed by copying and pasting if you prefer
This guide presents commands that can be executed to test a connection or a network in order to further specify the possible source of error.
Performing a Telnet
TELNET allows testing the connection to a server without taking into account all the additional settings of a mail client or an FTP client in order to determine the origin of a problem. If the connection fails on an SMTP server, you may need to check if your firewall is blocking port 587 or 465, for example.
on macOS
- search for Network Utility
- go to the Ping, Lookup, or Traceroute tab depending on what you want to test
- you can also use Terminal and in the window that opens, depending on what you want to test, type:
traceroute [server]
nc [server] [port]
Replace [server] with the server name or its IP address, same for [port]
on Windows
Activate Telnet beforehand if necessary.
- open Run and type cmd
- in the window that opens, depending on what you want to test, type:
tracert [server]
telnet [server] [port]
Example: telnet mail.infomaniak.com 587 (tests the SMTP port if your email software does not allow sending emails)
on Android
- use the free Simple Telnet Client application, which allows very simple testing via 2 fields to fill in (e.g., mail.infomaniak.com and port 143 or 993).
Performing a PING
PING allows knowing if a machine is accessible over the Internet. You can also check with this tool if you are addressing the correct machine, for example during a DNS change, by looking at the obtained IP address. It is possible to ping a domain name, a hostname, or an IP address.
Git and GitHub are available at Infomaniak with all hosting offers on:
and of course the Jelastic Cloud offer which will allow you deep integration of versioning.