• Resolved reptiguy1

    (@reptiguy1)


    I’ve been trying for that past 10 hours to try to get cookiless domain to work with multisite. I’ve got it working on single site if I convert the WP installation to a single site but when I switch it to MS it doesn’t take.

    Here’s the code in my wp-config file:

    ...
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    #define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'xxxxxx');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    define('SUNRISE', 'on');
    ...
    define("WP_CONTENT_URL", "http://static.xxxxx.com");
    define("COOKIE_DOMAIN", "www.xxxxx.com");
    define("WP_PLUGIN_URL", "http://www.xxxxxx.com/wp-content/plugins");

    and in my htaccess file:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    ## add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

    Cans someone please advise me. Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Would you care to share more info about this? What exactly are you trying to do? Currently, does any response from wp to non-authenticated users set cookies? I think no, but I would be very interested to know if it does otherwise in any particular case.

    Thanks in advance.

    George

    Thread Starter reptiguy1

    (@reptiguy1)

    I’m trying to create a cookieless domain for static content so that fewer queries are sent to the server. As I said I got it working on the single site and it’s super, super fast now! I recommend you try it out. Here’s the tutorial I used:

    https://www.itsupportguides.com/wordpress/wordpress-how-to-serve-static-content-from-a-cookieless-domain/

    For creating the subdomain, I just did it on godaddy as I do not have cpanel. Test your site on http://tools.pingdom.com/fpt/ to check if you got it running properly.

    If anyone knows how to get this working on multisite please post here.

    Hi

    did you solve this @reptiguy1 ?

    Hi, thanks for the clarification. For as far as I can tell, setting WP_CONTENT_URL should work for offloading content.

    Are you absolutely sure there is no analytics script or plugin setting a “.example.com” cookie? The dot before your-domain.com means a wildcard: include everything URL ending with example.com, so a cookie URL “.example.com” includes static.example.com.

    Thread Starter reptiguy1

    (@reptiguy1)

    I’ve tried to fix this since my last comment. I’ve switched back to single site mode and it works fine so I’m just marking this post as solved even though it isn’t 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cookiless Domain’ is closed to new replies.