Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Create and use a .htaccess file and .user.ini
This guide provides basic guidance for creating and using a file .htaccess
and .user.ini
with a Web hosting Infomaniak.
Preamble
- A file
.htaccess
places itself at the root of a website and allows to configure 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 set URL rewrite rules, impose access restrictions, manage HTTP errors, and even customize security aspects such as deactivating file/folder display.
- It also facilitates the establishment of redirections and aliases, thus providing precise control over the organisation and accessibility of the site.
- A file
.user.ini
allows for customize the PHP directives of the folder (and its subfolders) in which it is located.- By acting at the PHP interpreter level, this file allows you to define specific configurations for a given folder and its subdirectories.
- Thanks to its clear syntax, it offers the possibility to modify various parameters such as memory limit, script execution time, error management, and other PHP-related directives.
- This granular approach allows developers to finely customize PHP's behavior according to the specific requirements of each section of the site.
Create File...
… .htaccess
- Log in to your accommodation via FTP or SSH.
- At the root of the relevant website, create a new file and give it the following name:
.htaccess
. - Enter the desired instructions in the file; learn more about these other guides e.g.:
… .user.ini
- Log in to your accommodation via FTP or SSH.
- At the desired location, create a new file and give it the following name:
.user.ini
. - Enter the PHP configuration settings desired in the file.
âš çš„ File modification .user.ini
takes several minutes to be effective.
Link to this FAQ: