We often see large web sites that support comma-delimited css,js loading, such as:
<link type= "Text/css" rel= stylesheet "href=" http://s.juancdn.com/juanpi/css/?? base.css,globale.css,md-business.css,pg-enroll.css,pg-manage.css,pg-my-account.css,alert.css?ts=1234 "/>
<script src= "http://s.juancdn.com/common/js/?" jquery.min.js,base.js?ts=1234 "></script>
The following solutions are shown:
1, modify Apache configuration file httpd.conf and restart, such as the following established s.juancdn.com binding and support rewrite
<virtualhost *:80>
DocumentRoot "D:/wamp/www/static"
ServerName s.juancdn.com
<directory "D:/wamp/www/static" >
AllowOverride All
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>
2, root directory Add. htaccess
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritecond%{request_filename}!-f
Rewritecond%{query_string} ^ (. +) $
Rewriterule ^ (. *)/index.php [qsa,pt,l]
</IfModule>
3, the establishment of the import file index.php
<?php
$r = $_server[' Request_uri '];
Preg_match_all ("/\/" (. *?) \/?\?\? (.*?) (\?. *)/", $r, $matches);
if (!empty ($matches) &&!empty ($matches [1][0]) &&!empty ($matches [2][0])) {
$_get[' B '] = $matches [1][0];
$_get[' f '] = $matches [2][0];
}else{
Die ("Bad Request");
}
if (!empty ($matches) &&!empty ($matches [3][0])) {
Parse_str ($matches [3][0]);
}
Include_once ("min/index.php");
4, modify the configuration file min/config.php
Modify the following row of arguments to an existing address:
$min _cachepath = ' c:\\windows\\temp ';
5, modify the program's configuration file conf/test.php "This does not know need not"
Join:
'. css? ' => '. css ',//front-end static file path
'. js? ' => '. js ',//front-end static file path