What language is used in Apache's ".htaccess" file?

5

For example the following lines represent which language:

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri_path=$1
    
asked by anonymous 17.11.2016 / 20:47

1 answer

7

In a nutshell, it is a specific "language" for configuring Apache that does not have an explicit name in the documentation, nor is it restricted to .htaccess .

This is a collection of policies that are largely equivalent to the configuration parameters of the Apache HTTP Server, and the syntax is specifically tied to this.

As stated in the Apache manual, in the policies section:

  

That is:

  

They are described using a consistent format, and there is a dictionary of terms used in their descriptions.

At no point is a specific name given to this, everything is treated generally as a directive.


.htaccess is an extension of the settings, and it exists to be a facilitator in the sense that you can change specific parameters in different directories without even needing access to the general configuration.

Also, in the manual :

  

In general, .htaccess files use the same syntax as the main configuration files.


Specifically about the example given in the question, these are mod_rewrite , and in this case they use RegEx es , that is, Regular Expressions (more specifically PCRE) in certain parameters.

Links of interest:

17.11.2016 / 22:28