开发者

Can deflate/gzip be with "deny from all"?

开发者 https://www.devze.com 2023-04-11 08:07 出处:网络
I am kind of confused with the .htaccess file. I want gzip compression and deny from all in a directory. My question is can \"deny from all\" be with gzip compression or it has any problems?

I am kind of confused with the .htaccess file. I want gzip compression and deny from all in a directory. My question is can "deny from all" be with gzip compression or it has any problems?

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE applicatio开发者_运维百科n/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<Files *.html>
SetOutputFilter DEFLATE
</Files>

deny from all


deny from all means no one can access the directory directly via a URL. Any content sent to the browser from that directory has to come via a server-side script placed elsewhere, which means that .htaccess is bypassed entirely - so the compression won't take place.

Your server-side script will therefore have to perform the compression on its own using http_deflate before outputting the data from those files.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号