Base de conhecimento

1000 perguntas frequentes, 500 tutoriais e vídeos explicativos. Aqui, você encontra apenas soluções!

Create and use a .htaccess and .user.ini file

Atualização 26/05/2026

This guide provides basic instructions for creating and using a .htaccess and .user.ini file with an Infomaniak Web Hosting account.

 

Introduction

  • A .htaccess file is placed in the root directory 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 rewrite rules, impose access restrictions, manage HTTP errors, and even customize security aspects such as disabling the display of files/folders.
    • It also facilitates the implementation of redirects and aliases, providing precise control over the organization and accessibility of the site.
  • A .user.ini file allows you to customize the PHP directives for 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 of modifying various parameters such as the memory limit, the 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 a file…

 

.htaccess

  1. Connect to your hosting account via FTP or SSH.
  2. In the root directory of the website in question, create a new file and name it as follows: .htaccess.
  3. Enter the desired directives in the file; refer to this other guide, for example.

 

.user.ini

  1. Connect to your hosting via FTP or SSH.
  2. In the desired location, create a new file and name it as follows: .user.ini.
  3. Enter the desired PHP configuration settings in the file.

Modifying the .user.ini file takes several minutes to take effect.


Esta seção de perguntas frequentes foi útil?