1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Create and use a .htaccess and .user.ini file
This guide provides basic instructions for creating and using an .htaccess
and .user.ini
file with an Infomaniak Web Hosting.
The Differences
.htaccess
An .htaccess
file is placed at the root of a website and allows you to configure the Apache HTTP server.
As a decentralized configuration file, it offers significant flexibility to adjust the server's behavior according to the specific needs of the site. This file allows you to define URL rewriting rules, impose access restrictions, manage HTTP errors, and even customize security aspects such as disabling the display of files/folders. It also facilitates the setup of redirects and aliases, thus offering precise control over the organization and accessibility of the site.
.user.ini
A .user.ini
file allows you to customize PHP directives for the directory (and its subdirectories) where it is located.
Acting at the PHP interpreter level, this file allows you to define specific configurations for a given directory and its subdirectories. Thanks to its clear syntax, it offers the possibility to modify various parameters such as memory limit, script execution time, error handling, and other PHP-related directives. This granular approach allows developers to finely customize the behavior of PHP according to the specific requirements of each section of the site.
Create These Files
.htaccess
- Connect to your hosting via FTP or SSH
- At the root of the relevant website, create a new file and name it:
.htaccess
- Add the desired directives to the file, e.g.:
.user.ini
- Connect to your hosting via FTP or SSH
- In the desired location, create a new file and name it:
.user.ini
- Add the desired PHP configuration settings to the file
⚠️ Important: Modifying the .user.ini file may take several minutes to take effect.