Make CKEditor work with Apache’s mod_pagespeed
I am using CKEditor as a part of a CMS used to drive one of my sites and have found out that CKEditor has problems parsing CSS and JS files with Apache’s mod_pagespeed enabled — the CKEditor isn’t being shown on the page at all (mod_pagespeed is an Apache module for rewriting web pages to reduce latency and bandwidth – a great thing for SEO).
The solution is to disallow mod_pagespeed on CSS and JS files called by CKEditor. Since CKEditor is usually used in the non-indexed back-end (CMS, etc.) this wouldn’t have an impact on the front end of the website which will happily continue serving static content processed by mod_pagespeed.
The solution is to add the following to your mod_pagespeed configuration file (pagespeed.conf):
ModPagespeedDisallow */ckeditor/ckeditor.js
If you don’t have access to pagespeed.conf (i.e. you are using shared hosting) you can add the same directive to the .htaccess file in the root of your website directory. This works because ModPagespeedDisallow directive can be used with .htaccess and <Directory> scope. This is also by far the easiest method to fix the problem since virtually any half-decent hosting provider gives an ability to create custom .htaccess files.
You can also restrict mod_pagespeed from acessing a whole directory (including underlyting files) by using the following in your .htaccess file:
ModPagespeedDisallow */ckeditor/*

