在.htaccess中设置PHP-log位置 - 将子变量用于子域?

Okay. I have this in my .htaccess:

# enable PHP error logging
php_flag  log_errors on
php_value error_log  logs/php_errors.log

Which works, but I would like for the error-log to be named according to which subdomain is active (different subdomains use the same files, hence I can't just differentiate location based on specific files being loaded).

I tried to do this (but it doesn't work):

# enable PHP error logging
php_flag  log_errors on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST}        !^www
RewriteCond %{HTTP_HOST}         ^([^\.]+)\.([^\.]+)\.([^\.]+)$
php_value error_log  logs/php_errors_$1.log

It just returns php_errors_$1.log in the folder. So, is there a way I can assign that to a variable, and use that variable in the filename?

This is a little work around:

.htaccess:

php_value auto_prepend_file "/home/path/public_html/domain/setLogFile.php"

setLogFile.php:

<?php

// Get subdomain
$subdomain = array_shift((explode(".",$_SERVER['HTTP_HOST'])));

// Set log file
ini_set("log_errors", 1);
ini_set("error_log", "/home/path/public_html/domain/logs/php_errors_" . $subdomain);

?>