Welcome Guest, Not a member yet? Register   Sign In
Combining Javascript and CSS files to lower loading times.
#8

[eluser]Unknown[/eluser]
[quote author="zwippie" date="1202426563"]

Content of /ci/public/.htaccess:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ci/public
RewriteRule ^css/(.*\.css) /ci/public/combine.php?type=css&files;=$1
RewriteRule ^js/(.*\.js) /ci/public/combine.php?type=javascript&files;=$1
</IfModule>

As I said, I have not completely tested this, but it seems to work.[/quote]

Could not figure out for the life of me why this didn't seem to work on my install, then I noticed the semi-colons in the RewriteRules. It looks like the forum's filter is adding them in after the fact.

They should both end with:
files=$1

I also had to change the file name delimiter in combine.php from a comma (",") to a legal URI character. I chose the tilde ("~") since I don't think it will occur in my normal URIs, but perhaps it would be better to simply add the comma to CodeIgniter's list of legal characters. Any thoughts?


Messages In This Thread
Combining Javascript and CSS files to lower loading times. - by El Forum - 01-09-2009, 10:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB