admin管理员组

文章数量:1122832

I have a domain, for example tarikhema. I want to change WordPress default upload patch folder to another domain for example dtours. How can I do this?

My default folder is tarikhema/images/.... I want this: dtours/images/....

I have a domain, for example tarikhema.org. I want to change WordPress default upload patch folder to another domain for example dtours.net. How can I do this?

My default folder is tarikhema.org/images/.... I want this: dtours.net/images/....

Share Improve this question edited Oct 16, 2017 at 10:27 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Oct 16, 2017 at 6:40 Eni KazemiEni Kazemi 12 bronze badges 1
  • You can using WP Offload S3 or W3 Total Cache. Both examples are using AWS S3, there are probably other ways. But it's impossible to suggest anything without knowing how your domains are set up, if you're willing to use AWS, etc. – kero Commented Oct 16, 2017 at 8:44
Add a comment  | 

2 Answers 2

Reset to default 0

You can't do that. WordPress can store files only in its own uploads folder (or at least in the same root where the WordPress is installed. You can't upload files to remote website (different domain).

What you can do is to add the second domain as an alias to your main domain, and in that case, all URL's from the main domain will match the alias domain too.

JFI

We can do that by changing these two constant variables or can update from here as well.https://yourdomain.com/folder_name/wp-admin/options.php

Now find upload_path and change it to an absolute path of that folder where you want to upload images. after that find upload_url_path change it to the actual URL path and check once.

upload_path: /absolute/path/to/your/folder_name/wp-content/uploads

upload_url_path: https://yourdomain.com/folder_name/wp-content/uploads

本文标签: imagesChange wordpress default upload path to another domain