vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
在CustomLog 行上加入如下代码:
SetEnvIf Request_URI ".*\.gif$" p_w_picpath-request
SetEnvIf Request_URI ".*\.jpg$" p_w_picpath-request
SetEnvIf Request_URI ".*\.png$" p_w_picpath-request
SetEnvIf Request_URI ".*\.bmp$" p_w_picpath-request
SetEnvIf Request_URI ".*\.swf$" p_w_picpath-request
SetEnvIf Request_URI ".*\.js$" p_w_picpath-request
SetEnvIf Request_URI ".*\.css$" p_w_picpath-request
在CustomLog 行后添加:
env=!p_w_picpath-request
保存退出
apachectl -t
apachectl restart
转载于:https://blog.51cto.com/kratoslinux/1775117