How to set a Cookie-Free Domain with WordPress?

I recently set up a WordPress site here. I added these two lines in wp-config.php:

define("COOKIE_DOMAIN", "www.artisanplombier-pascher.com");
define("WP_CONTENT_URL", "https://static.artisanplombier-pascher.com/wp-content");

When I request the homepage and inspect the network queries with my browser, the assets are loaded with "static" subdomain, however a "cookie" header request is also sent along with the other parameters.

I don't know what I am missing.

Topic cookies installation deployment Wordpress optimization

Category Web


Your mistake is the WP_CONTENT_URL's postfix. You should set the definitions in the following manner:

define("COOKIE_DOMAIN", "www.artisanplombier-pascher.com");
define("WP_CONTENT_URL", "https://static.artisanplombier-pascher.com");

Then, you should configure the static. subdomain's path in your server's configuration file or your hosting's control panel. Create a subdomain named "static" or something similar and configure its path to your (WordPress) website's "wp-content" folder.

And finally, you need to check the following redirects:

https://static.artisanplombier-pascher.com -> is path to -> https://www.artisanplombier-pascher.com/wp-content

and your "upload" folder (images folder for wp) is here;

https://static.artisanplombier-pascher.com/uploads/image.jpg

and it's root domain path is;

https://www.artisanplombier-pascher.com/wp-content/uploads/image.jpg

Best Regards.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.