Forum Moderators: phranque
CookieTracking off
# stop auto index (which shows dir contents when there's no index.html/php file)
Options -Indexes
# caching -- start
Header unset ETag
FileETag None
Header unset Last-Modified
Header set Expires "Thu, 1 Jan 2030 00:00:00 GMT"
Header set Cache-Control "public, no-transform"
# caching -- end
RewriteEngine On
RewriteRule ^(.*)\.css$ \1.css.php [NC]
# compression -- start
SetOutputFilter DEFLATE
# compression -- end Look at the php script that is producing the css file. Since you say that the byte count is correct even on error, this would indicate a possible error in the script *after* the css file has been output. At this point, the script could throw an error and write a 500 error code in your access log, and yet the css "file" content would be correct.
[edited by: jboy at 2:36 pm (utc) on Feb 1, 2011]
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; eMusic DLM/4)"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; GTB6.6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; tco2; GTB6; .NET CLR 1.1.4322)"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.6; InfoPath.2)"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.6; InfoPath.2)"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.6; InfoPath.2)"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; GTB6.6; InfoPath.2)"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC1; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; WinTSI 03.01.2010)"
If these .css.php filepaths are being 'exposed' as URLs, that indicates that your redirect and rewrite directives are not in the correct order. All redirects must execute before any internal rewrites can execute.
If you are attempting to match real files named .css.php, then "\.css\.php$ would be the correct pattern for a FilesMatch directive.
<FileMatch "php">
SetOutputFilter DEFLATE
</FileMatch>
However, if these are not physically-existing files, then FilesMatch can't be used at all, and you'll need to use a different method to enable or disable compression.