PHP - compress static css file with GZIP

泄露秘密 提交于 2019-12-04 14:14:57

If your web server has such feature, you can use URL rewriting to keep things tidy.

An example with mod_rewrite:

RewriteRule ^images/style\.css$ lib/c.php?css=../style.css

Then, you can simply:

@import "http://mysite.com/images/style.css";

I also recommend you give a second look to your script. What happens if I load this URL?

http://mysite.com/lib/c.php?css=.htpasswd
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!