Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

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

share|improve this answer
    
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 '13 at 9:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.