压缩js& MOD放气的CSS文件不可用 [英] Compressing js & css files where mod deflate not available

查看:79
本文介绍了压缩js& MOD放气的CSS文件不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Magento网站使用共享的1and1程序包,看来我无法使用通过htaccess压缩css和js文件的标准方法.我遇到了这个 http://mrrena.blogspot.co.uk/2009/01/how-to-compress-php-and-other-text.html ,这提供了一种有趣的方法,该方法似乎可行.但是,我需要在每个具有要压缩的css或js文件的目录中放置一个php.ini文件.对于像Magento这样的东西,这是很痛苦的.有什么办法可以使用诸如htaccess之类的分层方法?

I'm using a shared 1and1 package for a Magento website and it seems I can't use the standard approach of compressing css and js files via htaccess. I came across this http://mrrena.blogspot.co.uk/2009/01/how-to-compress-php-and-other-text.html which gave an interesting approach which seems to work. However, I need to put a php.ini file in every directory that has css or js files that I want compressed. For something like Magento, this is quite a pain. Is there any way I can use a hierarchical approach such as with htaccess?

推荐答案

我发现了.user.ini文件,该文件正是我想要的.因此,现在我的根文件夹中只有一个.user.ini文件,并且删除了所有php.ini文件.

I discovered the .user.ini file which does precisely what I want. So now I have a single .user.ini file in my root folder and I've removed all of the php.ini files.

有关详细信息,请参见此处: http://php.net/manual/zh-CN/configuration.file.per-user.php (我在.user.ini上找不到的在线文档特别好).

See here for some detail: http://php.net/manual/en/configuration.file.per-user.php (none of the online documentation I could find on .user.ini was particularly good).

这篇关于压缩js& MOD放气的CSS文件不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆