Some users after enabling the plugin may see the display of the website looking 'messed up'. This means the web page is displayed with mostly text without any of the original rich formatting and colors as before with maybe some of the images missing, and the structure of the page is disturbed. This means that the page is being displayed without any CSS formatting.
JCH Optimize url not working
This happens because the plugin has removed all the links to your CSS and javascript files from the HTML and replaced them with a generated link to the combined file, but for some reason the browser is not downloading the contents of the combined file from the plugin's url. To solve this issue we must find out why the url is not working and fix the problem. Fortunately, most times this is very easily done.
Check the JCH Optimize generated link
First we need to confirm that this is actually the issue at hand so check the HTML source of the your page and look for the JCH Optimize links. To do this, right click in your browser and select the 'View Source' item from the context menu. In Joomla! the JCH Optimize links look like this:
/media/plg_jchoptimize/assets/gz/30/0/f8546637a79836c9f19325fe596eef67.js
Click on the link or paste it in the address bar of your browser. You should see the contents of the combined file but in your case you may see an error message.
How to fix
The error message that is displayed when we try to access the combined file will give us an indication of what is wrong and how to fix it.
1. Ensure that caching is working properly
If you see a 'File not found' error message, then the issue has to do with caching. The plugin caches the combined files so this error means that the cached file is not found. Ensure the plugin is ordered properly (if you're on Joomla!) and clear all your cache. Turn off all cache plugins until you have it working properly.
If you're on Joomla there's a plugin Content - Facebook-Twitter-Google+1
that deletes all your cache including the JCH Optimize cache required for the plugin to work. You can't use this plugin if you're using JCH Optimize. If you're interested in speeding up your site you shouldn't be using this plugin anyway as caching is the easiest way to reduce server response time.
2. Turn off url rewriting
If you see a 404 or 500 error code then the problem could be url rewriting. The plugin uses url rewriting to generate the link to the combined file but perhaps this is not enabled on your server or is not working as expected. Disable the 'Use url rewriting' in Advanced Options. If you're on an NGINX server then add these code in your configuration file to enable url rewriting for the plugin:
rewrite ^(.*?)/media/plg_jchoptimize/assets.*?/(gz|nz)/([^/]+)/([^/]+)/([^/]+)\.(js|css)$ $1/media/plg_jchoptimize/assets/jscss.php?f=$5&type=$6&gz=$2&d=$3&i=$4;
3. Fix file permissions
A 500 error code can also mean incorrect permissions so if the above doesn't fix the problem check the file permissions. Via FTP or your cpanel File Manager, check the permissions of your /media/plg_jchoptimize/assets/jscss.php
and /media/plg_jchoptimize/assets2/jscss.php
files. These should normally be 644 but check with your host to be sure as your server could be configured differently. Also check the permissions of all the folders in that url to ensure they are correct. Folder permssions are usual 755. You can compare them to the permissions of your other files and folders on your server that are working to verify that you are using the correct permissions, or as mentioned above, check with your host.