0

I have this configuration ...

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

SetEnvIf Request_URI "^/MyUrl1/*" p_myurl1
CustomLog /var/log/apache2/myurl1_access.log common env=p_myurl1
SetEnvIf Request_URI "^/MyUrl2/*" p_myurl2
CustomLog /var/log/apache2/myurl2_access.log common env=p_myurl2

But when the url ...

www.mydomain.com/MyUrl2/blablabla.php is typed, I want this logged to myurl2_access.log but it logs to access.log. Why?

1 Answer 1

0

I think that you regexp should look like this: "^/MyUrl2/.*$" instead of this: "^/MyUrl2/*"

1
  • I'd leave out the $ - there's no need to specify that it should match until the end of the string. Otherwise I agree.
    – Jenny D
    Feb 13, 2013 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .