Smartoptimizer

I just installed Smartoptimizer and cant seem to get it working.





The server is Apache with mod_rewrite enabled.



before my site would lose all the CSS and JAVA files after 10 minutes of running…



Then I changed the HTACCESS file so the Smartoptimizer code was the first code on the file.



That seems to make the site normal, but now my admin section has no CSS or Java…





Please advice…



```php DirectoryIndex index.html index.php









ExpiresActive On

ExpiresDefault “access plus 10 years”







RewriteEngine On



RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(..(js|css))$ smartoptimizer/?$1





RewriteCond %{REQUEST_FILENAME} -f

RewriteRule ^(.
.(js|css|html?|xml|txt))$ smartoptimizer/?$1







RewriteCond %{REQUEST_FILENAME} -f

RewriteRule ^(.*.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt))$ smartoptimizer/?$1







FileETag none













RewriteEngine on

Some hostings require RewriteBase to be uncommented

Example:

Your store url is http://www.derbysmack.com/

So “RewriteBase” should be:

RewriteBase /

RewriteBase /

RewriteRule ^sitemap.xml$ ./index.php?dispatch=xmlsitemap.view [L]

RewriteCond %{REQUEST_FILENAME} !.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



RewriteCond %{REQUEST_FILENAME} ./catalog/.

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_FILENAME}/index.html !-f

RewriteRule . index.php?sef_rewrite=1 [L,QSA]

```

Hello Nathand,



Try to clean your SO cache:



/smartoptimizer/cache





Lee Li Pop

I’m having the same issue with smartoptimizer. It’s perfect for the frontend, but it messes up css and javascript in the admin area.



Maybe we can disable css and js caching for the backend in the .htaccess file?



Anyone have any luck with this?

I installed it once, it really screwed my frontend, css and js was a mess. I was not sure if the program tried to re-write or move the CSS and JS around… :frowning:





I had no time to mess with it later on.

Everything works fine for me until I try and add gzip lines in .htaccess along with smartoptimizer…


php_flag zlib.output_compression On
php_value zlib.output_compression_level 5




That’s when it messes up my css and js. I’m also using zeke’s sql lite caching system.

Is it possible it tries to apply zlib compression on top of zlib compression that is done by apache or php?

Well, in the smartoptimizer config file, there is this line:


//use this to set gzip compression On or Off
$settings['gzip'] = true;




But whenever I check to see if my site is sending out compressed content, it looks like it’s not, at least without adding the php flags in my .htaccess (which seems to conflict)

on the robot it shows:



Fatal error: Unknown: Cannot use both zlib.output_compression and output_handler together!! in Unknown on line 0




at the bottom. we just copied the htaccess file from smartopt. to default htaccess, bbut there is also another htaccess under smartopt. folder.

if we delete he htaccess under smartopt. folder then site shows without correct css.



if we put it it looks fine but it gives robot error.



any idea?

[quote name='silverbestbuy' timestamp='1309028919' post='115747']

on the robot it shows:



Fatal error: Unknown: Cannot use both zlib.output_compression and output_handler together!! in Unknown on line 0




at the bottom. we just copied the htaccess file from smartopt. to default htaccess, bbut there is also another htaccess under smartopt. folder.

if we delete he htaccess under smartopt. folder then site shows without correct css.



if we put it it looks fine but it gives robot error.



any idea?

[/quote]



Most configs should delete the .htaccess in the SO folder.



Please see Thanks everyone for your help, I am launched! - General Questions - CS-Cart Community Forums for a - I hope - easy guide on how to install SO properly.

when we delete it, css brakes…strange.

Digging up an old thread, but nobody posted a solution. Just in case anybody comes across this issue again, as I just found out, here's how to fix it. Note, you do not need to apply these changes unless you receive the error:


Fatal error: Unknown: Cannot use both zlib.output_compression and output_handler together!! in Unknown on line 0


Open /smartoptimizer/.htaccess



Replace with:


php_flag zlib.output_compression Off
php_flag output_buffering Off