Answer the question
In order to leave comments, you need to log in
How to transfer images to a subdomain in Wordpress?
Hello. The question is, there is an online store Wordpress+Woocomerce.
I want to make images loaded from a subdomain of my site.
Now the pictures are loaded with Photon from JetPack, but the validator swears at these pictures, because ALT tags are not assigned to them.
Previously, in the Wordpress settings, you could change the address of the images. Now there is no such possibility.
I would like to do it without plugins.
Answer the question
In order to leave comments, you need to log in
An option if everything is already set up and you need to "transfer" the statics to a subdomain.
Add static.example.com to nginx
server {
server_name example.com static.example.com;
}
http://static.example.com/wp-content/uploads
. Now new pictures will be added with this path. http://static.example.com/wp-content/uploads
wp search-replace 'http://example.com/wp-content/uploads' 'http://static.example.com/wp-content/uploads'
define('COOKIE_DOMAIN', 'example.com' );
define('WP_PLUGIN_URL', 'http://static.example.com/wp-content/plugins');
here is a plugin for that:
https://wordpress.org/plugins/wp-original-media-path/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question