modrewrite 用于 css / jss 缩小版
我有一个托管在 CentOS 5-Plesk-Apache 服务器上的网站。我最近向服务器添加了第二个站点来提供动态内容。我已经为图像(静态内容)建立了重写规则,效果非常好。该模块重写静态服务器中的 URI 以指向原始文件。
问题是第一个网站有 minify (http://code.google.com/p/ minify/) 脚本已安装,但我不知道如何编写有效的 modwrite 规则,所以如果我有:
...
<样式 src='http://www.mystaticserver.com/min/f=style。 css' >
...
文件中
在某个地方,这会出现在具有以下 URL http://www.myserver 的 .com/min/f=style.css
有什么想法吗?提前谢谢您
PS:我在 serverfault 中问了这个问题,但没有得到任何答案
I have a web site hosted in a CentOS 5-Plesk-Apache server. I have recently added a second site to the server for serve dynamic content. I have established rewrite rules for images (static content) that works pretty well. The module rewrites the URI in the static server to pointing to the the original file.
The problem is that the first site has the minify (http://code.google.com/p/minify/) script installed but i cannot realize how to write a modwrite rule that works, so if I have:
...
< style src='http://www.mystaticserver.com/min/f=style.css' >
...
somewhere, this becomes in the file with this URL
http://www.myserver.com/min/f=style.css
Any ideas? Thank you in advance
PS: I asked this question in serverfault but i don't get any answers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您尝试在 .htaccess 文件中使用哪些重定向规则?
如果您将请求发送到不同的服务器,您是否使用重定向匹配?
此外,如果您要包含查询字符串,则可能需要将选项 [QSA] 应用到规则末尾才能包含它。
What are the redirect rules you are trying to use in the .htaccess file?
If you are sending the request to a different server, are you using redirectmatch?
Also, if you are including a query string you may need to apply the option [QSA] to the end to the rule to include it.
感谢 serverfault.com 的人们...这就是答案:
https: //serverfault.com/questions/64223/modrewrite-for-css-jss-minified/65843#65843
Thaks to the guys at serverfault.com... This is the answer:
https://serverfault.com/questions/64223/modrewrite-for-css-jss-minified/65843#65843