Is there a way to separate wp-content/uploads on different server ?
I mean if i have two servers. Serv1 and Serv2 . On Serv1 is the wordpress installation and on Serv2 stays only the uploads folder.
I try to use ftp like:
define( 'UPLOADS', 'ftp://user:pass@Serv2/wp-content/uploads' );
on Serv1.It works but when you point image on the site the URL is with ftp user and password. So that’s unusable.
Is there any normal way to do it ?
Regards.
2 comments
Comments are closed.
Assuming you want to have a CDN effect or even for some security reasons (we also look into that but CDN will cost us too much (we have over 1TB monthly)), maybe following links will guide you into the right direction.
This info I found here on stackechange itself
These links tell some about using a subdomain as goal but seems also very usefull.
– This link shows explenation for redirecting your images. (or actual your upload dir)
– Another link with info (for subdomains) you find here.
Hopefully it helps you into the right direction. As soon I figured out best way myself I will put answer here also.
A simple way to do this is to go into the database for WordPress, I use php my admin which works fine, find the wp_options table and change the option ‘uploads_url’ to a directory on another server. This will automatically change the file path of any file uploaded via the inbuilt WordPress media loader to the new path, even if it’s on another server. You can then set the read permission of the file to public and write permissions to accept your first server’s IP address and you are away.
This is not the most secure way of accomplishing this, especially if your first server is under shared hosting however it does provide a very simple way of separating your uploads folder from your main server.