IntelliJ IDEA 2023.2 Help

Use distributed configuration files (.htaccess)

IntelliJ IDEA provides syntax highlighting, formatting, code completion and documentation lookup while editing distributed configuration files.

Distributed configuration files are used to make directory-based changes to the HTTP Apache Server configuration and usually have the name .htaccess.

If you are using a file with the name .htaccess, IntelliJ IDEA recognizes it as distributed configuration file and provides full coding assistance for it, so no additional steps are required from your side.

If you want to use a file with another name, you need to associate this full name or the corresponding pattern with the distributed configuration file type. After that, IntelliJ IDEA will treat any file with the name matching the specified pattern as a distributed configuration file and process it accordingly.

Install the PHP and Apache config plugins

This functionality relies on the PHP and Apache config (.htaccess) plugins that should be installed and enabled in your IDE.

The plugins are available only in IntelliJ IDEA Ultimate.

  1. Press Control+Alt+S to open the IDE settings and then select Plugins.

  2. Switch to the Marketplace tab and use the search field to find the PHP and Behat Support plugins.

  3. Click Install and restart the IDE if prompted.

Associate a name pattern with the distributed configuration file type

  1. In the Settings dialog (Control+Alt+S), and select Editor | File Types.

  2. Select Apache Config from the Recognized File Types list.

  3. In the File name patterns area, click the Add button.

  4. In the Add Wildcard dialog that opens, specify the pattern that defines the extensions of your distributed configuration files.

  5. Click OK. IntelliJ IDEA returns you to the File Types page where the specified pattern is added to the File name patterns list.

    • To discard a pattern, select it in the list and click the Remove button.

    • To change a pattern, select it in the list, click the Edit button, and update the pattern as necessary in the Add Wildcard dialog that opens.

Last modified: 26 June 2023