We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

SL Combinator : Combine and Compress JavaScript and CSS on-the-fly : Version Update (2.1.0) 1st April, 2009

Development and Programming

Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi electiv,

The new version works great for the JS, but when I use the SL Combinator for the CSS, it doesn’t work. The CSS just doesn’t load. When I go to the direct URL for the CSS that’s published by the SL Combinator for the CSS, I get a HTTP 400 Bad Request error.

I’m guessing that after our previous conversation it’s not a PHP-version issue 😉

Nothing springs to mind immediately, which means I’ll need to do some digging, and try to replicate the problem. I’ll get back to you with a more informed response as soon as I can.

Cheers, Stephen

       
eclectiv's avatar
eclectiv
133 posts
16 years ago
eclectiv's avatar eclectiv

Hi Stephen,

I think I figured out what the problem is. I had my CSS files located in a subdomain, which seems to have been the issue. When I moved the CSS files to root level, everything worked fine. Hope that helps! Thanks so much for the fantastic work!

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi eclectiv,

I think I figured out what the problem is. I had my CSS files located in a subdomain, which seems to have been the issue. When I moved the CSS files to root level, everything worked fine.

Aha, that would be a problem, yes. The plugin can handle files in subdirectories just fine, but not subdomains.

Hope that helps! Thanks so much for the fantastic work!

Good to know you’ve got it sorted, and you’re welcome 😊

Cheers, Stephen

       
stef25's avatar
stef25
268 posts
16 years ago
stef25's avatar stef25

hi stephen,

the code below shows a 403 forbidden error in firebug. the min and min/cache folders have 777 rights, plugin V2, PHP5. any idea what im doing wrong?

{exp:sl_combinator:combine_js disable="no" debug="yes"}
[removed][removed]    
[removed][removed]
{/exp:sl_combinator:combine_js}

edit - it wont list the script tags inside the sl_combinator tags, but they are normal js include script tags that work fine outside of the tags.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi stef25,

any idea what im doing wrong?

Nothing immediately springs to mind. I’ll have to see if I can recreate the problem locally, because at the moment I have no idea what’s causing that.

Let me know if you have any more information that could point me in the right direction.

Cheers, Stephen

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind
Hi eclectiv,
I think I figured out what the problem is. I had my CSS files located in a subdomain, which seems to have been the issue. When I moved the CSS files to root level, everything worked fine.
Aha, that would be a problem, yes. The plugin can handle files in subdirectories just fine, but not subdomains.
Hope that helps! Thanks so much for the fantastic work!
Good to know you’ve got it sorted, and you’re welcome 😊 Cheers, Stephen

Hey Stephen, I am having difficulties getting this working. I am attempting to get this to work on a site in development that is actually hosted on a subdomain. AFAIK I have the settings setup properly, but when I turn it on, it doesn’t seem to work.

Would it be not working because my entire site is hosted on a subdomain? Seems odd. This is what it is outputting instead of the actual minified stuff.

{exp:sl_combinator:combine_css disable="no" debug="no"}
<link rel="stylesheet" href="http://subdomain.site.com/themes/site_themes/site_themes/layout.css" type="text/css" media="screen" charset="utf-8" />
{/exp:sl_combinator:combine_css}

renders this:

<link rel="stylesheet" type="text/css" media="screen" href="http://subdomain.site.com/scripts/min/?f=http://subdomain.site.com/themes/site_themes/theme_folder/layout.css" />

Any idea what could be going wrong?

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi they inspire,

Hey Stephen, I am having difficulties getting this working. I am attempting to get this to work on a site in development that is actually hosted on a subdomain. AFAIK I have the settings setup properly, but when I turn it on, it doesn’t seem to work.

Have you tried it using an absolute URL from the subdomain root, rather than the full HTTP URL? i.e.:

{exp:sl_combinator:combine_css disable="no" debug="no"}
<link rel="stylesheet" href="/themes/site_themes/site_themes/layout.css" type="text/css" media="screen" charset="utf-8" />
{/exp:sl_combinator:combine_css}

Let me know how you get on.

Stephen

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Hey Stephen, yeah, actually I have tried every possible combination of urls. I am also using .htaccess rewrite to remove index.php, here is the .htaccess, should be normal no?

# remove index.php (Include List Method)
RewriteEngine on
RewriteCond $1 ^(home|scripts|_globals|bathroom|kitchen|about|locations|search|contact|careers|news|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php?/$1 [L]

If I change it to a absolute url, and this is what gets output:

{exp:sl_combinator:combine_css disable="no" debug="no"}
<link rel="stylesheet" href="/themes/site_themes/theme_folder/layout.css" type="text/css" media="screen" charset="utf-8" />
{/exp:sl_combinator:combine_css}
<link rel="stylesheet" type="text/css" media="screen" href="http://subdomain.site.com/scripts/min/?f=themes/site_themes/theme_folder/layout.css" />

is still what I am getting. :( hope that helps narrow it down

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hm.

The plugin is outputting the code correctly, which suggests that the problem resides with the actual minify code. My first guess would be that there are problems retrieving the server path to the files, because of the configuration of your subdomain.

I’ve cobbled together a very basic test script (attached). Drop it into the root of your subdomain, and visit it in your browser. It should output the correct server path to your test file; if it doesn’t, there’s probably something squiffy in the way DOCUMENT_ROOT works on your subdomain.

Let me know how you get on, and we’ll see if there’s a way around the problem.

Cheers, Stephen

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Hey Stephen,

Did as you said, and it seemed to output the server path fine. I am re-upping the /min/ folder to see if that changes anything. Other than that I am not sure what could be causing this to not work. Real bummer because I was really excited about using this extension.

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

hmm no dice :/

I am hoping this works itself out once I push the site to the actual live server. Maybe it is something to do with the subdomain.

FWIW: PHP Version 5.2.6

Cheers, thanks for your help, much appreciated.

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Hmm, I tried this on another site, just to test, and I am getting the same result. Odd for sure. This site is a live site, not residing on a subdomain either.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
Hmm, I tried this on another site, just to test, and I am getting the same result. Odd for sure. This site is a live site, not residing on a subdomain either.

It’s not working, even on when on the main domain? That is weird.

A couple of quick tests you can try (using the code you pasted above as an example): 1. Visit http://subdomain.site.com/scripts/min/?f in your browser. This should display a “400 Bad Request” error (or similar). 2. Visit http://subdomain.site.com/scripts/min/?f=themes/site_themes/theme_folder/layout.css in your browser. This should display the compressed CSS. 3. Visit http://subdomain.site.com/themes/site_themes/theme_folder/layout.css in your browser, to confirm that it displays the uncompressed CSS code correctly.

Let me know how you get on.

Stephen

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Hey Stephen,

Sorry about that, I ended up getting it working 😊 I was confused, I thought that the plugin wrote out a new file that would be in the cache folder that it would link to, instead of those urls with /f?=blah stuff. It’s working as expected, and thanks so much for making such a useful plugin.

cheers

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
Sorry about that, I ended up getting it working I was confused, I thought that the plugin wrote out a new file that would be in the cache folder that it would link to, instead of those urls with /f?=blah stuff. It’s working as expected, and thanks so much for making such a useful plugin.

Ah right. The “/?f=blah” stuff is passing minify a list of files to combine and compress. Minify does its thing, and then caches the resultant file for future use.

Glad you got it all sorted anyway.

Cheers, Stephen

       
1 2 3 4 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.