Title: Problem using cookie free domain
Last modified: August 31, 2016

---

# Problem using cookie free domain

 *  [Elpo](https://wordpress.org/support/users/elpo/)
 * (@elpo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/)
 * Hello,
    I’m using cookie free domain to serve static files like css, js and so
   on. I’ve added this code define(“WP_CONTENT_URL”, “[http://static.yourdomain.com&#8221](http://static.yourdomain.com&#8221););
   define(“COOKIE_DOMAIN”, “www.yourdomain.com”); on wp-config.php to use cookie
   free domain.
 * But after enabling this, combining css into one using autoptimize plugin doesn’t
   works.
    Is there has no way to work plugin properly?
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6975782)
 * set your CDN URL in AO to static.yourdomain.com and it should work 🙂
 * frank
 *  Thread Starter [Elpo](https://wordpress.org/support/users/elpo/)
 * (@elpo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6975811)
 * Setting CDL URL doesn’t works.
    I think it’s because cookie free domain root 
   folder is wp-content, so it doesn’t contain wp-content on urls.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6975820)
 * indeed, for this to function your wp-content url should be static.yourdomain.
   com/wp-content/ else AO won’t be able to fetch the CSS/JS on that.
 * frank
 *  [locker](https://wordpress.org/support/users/locker/)
 * (@locker)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976118)
 * Got the same bug.
 * My static domain config is:
 *     ```
       server {
               listen 80;
               server_name static.site.com;
               root /var/www/html/site.com/public_html;
       }
       ```
   
 * wp-config.php
 * `define("WP_CONTENT_URL", "http://static.site.com/wp-content");`
 * I post “CDN Base URL” as [http://static.site.com](http://static.site.com), but
   still got some js/css not comressed.
 * If I comment WP_CONTENT_URL everything is ok.
 * What I dooing wrong?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976124)
 * [@locker](https://wordpress.org/support/users/locker/): make sure to also set
   the WP_CONTENT_DIR constant [as explained in this wordpress codex article](https://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder).
 * there still might be a some files in wp-includes not aggregated due to a known
   bug [that is fixed on the development-version](https://github.com/futtta/autoptimize/commit/761b94135fd11d66eca9dbbd9a630070587757fb).
   If you’re into that kind of things you could edit autoptimize.php to include 
   the fix or you could [download the entire in-development version here](https://github.com/futtta/autoptimize/archive/master.zip).
 * hope this helps,
    frank
 *  [locker](https://wordpress.org/support/users/locker/)
 * (@locker)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976136)
 * Nope, it doesn’t help for me.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976137)
 * will need more info if you want more help locker. a URL, to start with, maybe?
   🙂
 *  [locker](https://wordpress.org/support/users/locker/)
 * (@locker)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976138)
 * URL is [http://woc-news.ru](http://woc-news.ru)
 *  [locker](https://wordpress.org/support/users/locker/)
 * (@locker)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976139)
 * sorry, I can’t post url. domain is woc-news zone is ru
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976140)
 * OK, time for some questions;
    * you have JS optimization on and CSS & HTML optimization
   off, right? * what do you have in the JS optimization exclusion list (under advanced
   options)? * what do you have as CDN domain in Autoptimize settings? * did you
   apply the fix from the development-version (or download the entire github zipfile
   to overwrite AO 2.0.0)?
 * frank
 *  [locker](https://wordpress.org/support/users/locker/)
 * (@locker)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976141)
 * My config:
 * JavaScript Options
 * – Optimize JavaScript Code: yes
    – Force JavaScript in <head>: yes – Also aggregate
   inline JS: yes – Exclude scripts from Autoptimize: s_sid,smowtion_size,sc_project,
   WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,seal.js – Add try-catch
   wrapping: no
 * CSS Options
 * – Optimize CSS Code: yes
    – Generate data: URIs for images: yes – Remove Google
   Fonts: yes – Also aggregate inline CSS: no – Inline and Defer CSS: no – Inline
   all CSS: no – Exclude CSS from Autoptimize: admin-bar.min.css, dashicons.min.
   css
 * CDN Options
 * – CDN Base URL: [http://static.woc-news.ru](http://static.woc-news.ru)
 * My wp-config.php
 * define(‘WP_CONTENT_URL’, ‘[http://static.woc-news.ru&#8217](http://static.woc-news.ru&#8217););
   
   define(‘WP_CONTENT_DIR’, dirname(__FILE__) . ‘/wp-content’); define(‘COOKIE_DOMAIN’,‘
   woc-news.ru’);
 * My wp-content/plugins/autoptimize/autoptimize.php
 * // wp-content dir, dirname of AO cache dir and AO-prefix can be overridden in
   wp-config.php
    if (!defined(‘AUTOPTIMIZE_CACHE_CHILD_DIR’)) { define(‘AUTOPTIMIZE_CACHE_CHILD_DIR’,’/
   cache/autoptimize/’); } //if (!defined(‘AUTOPTIMIZE_WP_CONTENT_NAME’)) { define(‘
   AUTOPTIMIZE_WP_CONTENT_NAME’,’/wp-content’); } if (!defined(‘AUTOPTIMIZE_WP_CONTENT_NAME’)){
   define(‘AUTOPTIMIZE_WP_CONTENT_NAME’,’/’.wp_basename( WP_CONTENT_DIR )); } if(!
   defined(‘AUTOPTIMIZE_CACHEFILE_PREFIX’)) { define(‘AUTOPTIMIZE_CACHEFILE_PREFIX’,‘
   autoptimize_’); }
 * Finally I update cache, but nothing happened. As you se the source code still
   contains a lot of css/js files.
 *  [locker](https://wordpress.org/support/users/locker/)
 * (@locker)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976142)
 * Sorry for duplicate
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976143)
 * as per [the codex-article](https://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder)
   your wp-config.php is wrong;
 *     ```
       define('WP_CONTENT_URL', 'http://static.woc-news.ru');
       define('WP_CONTENT_DIR', dirname(__FILE__) . '/wp-content');
       ```
   
 * should actually be
 *     ```
       define('WP_CONTENT_URL', 'http://static.woc-news.ru/wp-content');
       define('WP_CONTENT_DIR', dirname(__FILE__) . '/wp-content');
       ```
   
 * frank

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Problem using cookie free domain’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 13 replies
 * 3 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/problem-using-cookie-free-domain/#post-6976143)
 * Status: not resolved