SetEnvIf is not blocking image requests
Hi guys,
I am trying to block the image requests in access_log by adding below lines to httpd.conf. But somehow it is not working and image requests are still shown on logs. (They are too unnecessary and causing the log's size getting increase fastly)
SetEnvIf Request_URI "\.css" dontlog
SetEnvIf Request_URI "\.js" dontlog
SetEnvIf Request_URI "\.gif" dontlog
SetEnvIf Request_URI "\.jpg" dontlog
SetEnvIf Request_URI "\.jpeg" dontlog
SetEnvIf Request_URI "\.png" dontlog
CustomLog /usr/local/apache/logs/access_log common env=!dontlog
Some part of logs after change httpd.conf and restart (stop-start) apache:
./SAP-icons.ttf HTTP/1.1" 200
./SAP-icons.ttf HTTP/1.1" 200
./View.controller.js HTTP/1.1" 200
./SelectionView.view.js HTTP/1.1" 200
./SelectionView.controller.js HTTP/1.1" 200
./View.view.js HTTP/1.1" 200
./View.controller.js HTTP/1.1" 200
./View.view.js HTTP/1.1" 200
./View.controller.js HTTP/1.1" 200
./View.view.js HTTP/1.1" 200
./views/FQConfirmView.controller.js HTTP/1.1" 200
./thirdparty/mobiscroll/js/mobiscroll-core.js HTTP/1.1" 200
./thirdparty/mobiscroll/css/mobiscroll-core.css HTTP/1.1" 200
./thirdparty/mobiscroll/js/mobiscroll-scroller.js HTTP/1.1" 200
./thirdparty/mobiscroll/js/mobiscroll-datetime.js HTTP/1.1" 200
I guess syntax is correct (I tried them either "\.css" or \.css). What would be the reason that it does not work ?
Last edited by Revenge7; 12-04-2015 at 01:43 AM.
|