I want to change the upload directory for WordPress from project.dev/wp-content/uploads
to cdn.project.dev
Where subdomain cdn has DocumentRoot:
HostPath/project.dev/cdn
while WordPress is located at HostPath/project.dev/public_html
Any help is much appreciated.
if you need to change default media upload location,you need to edit the
wp-config.php
file located in the root directory of your WordPress installation. If you want upload directory to be wp-content/files then you will need to place the following code in wp-config.phpIf you want the upload directory to be outside wp-content, like project.dev/cdn then you need to set upload path in wp-config.php like this:
For exstining images:-
Copy all the exstining images of uploads folder to new folder which has set in the wp-config.php file.
The above information is only to Change the Default Media Upload Location.
For Details visit :WordPress Codex
Open your wp-config.php file, locoed at the root of your WordPress installation, and add the following snippet:
Make sure you add this code before the line: