It is possible write any kind of condition (IF) in .htaccess to apply some specific actions ?
#if hostname = xxx then
php_flag display_errors on
php_flag display_startup_errors on
#end if
Yes, you can use Apache Expressions on Apache 2.4+.
For example:
<If "%{HTTP_HOST} == 'xxx'">
php_flag display_errors on
php_flag display_startup_errors on
</If>
UPDATE: is possible use like/contains in operator? Something like HTTP_HOST like
*.test.mydomain.com
?
You can use various operators. For that example, you probably want to use a regular expression (using the =~
operator). For example:
<If "%{HTTP_HOST} =~ m#\.test\.mydomain\.com$#">
:
</If>
.htaccess
alone... you will need access to the server config to proceed further (in order to Define
a variable that can be checked later in .htaccess
). However, depending on how your vHosts are configured, this may not be practical. It may be preferable to define these "PHP settings" in your PHP code itself.