我在.htaccess文件中添加了几行来压缩文件并提高网站速度。

但是之后,某些javascript无法正常工作。所以我从.htaccess文件中删除了这些行。

这些javascript的问题一直存在。

如何恢复条件?

.htaccess中添加了代码,并随后从中删除了代码:

# compress text, HTML, JavaScript, CSS, and 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 application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

最佳答案

您可以使用RemoveOutputFilter指令。

RemoveOutputFilter text/plain
RemoveOutputFilter text/html
RemoveOutputFilter text/xml
RemoveOutputFilter text/css
RemoveOutputFilter application/xml
RemoveOutputFilter application/xhtml+xml
RemoveOutputFilter application/rss+xml
RemoveOutputFilter application/javascript
RemoveOutputFilter application/x-javascript

关于javascript - 如何还原GZIP压缩?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32717374/

10-10 06:17