If all you want to do is to have a “cdn” type url, the easiest solution that do not require any programing is to make HostPath/project.dev/cdn
a symlink to project.dev/wp-content/uploads. This way for theOS both paths are essentially the same. This should be easy to do if you are in full control of the server and/or have SSH access, or might require help from your hosting if you do not have this kind on access.
Another option if you have control on the web server configuration is to map the “document root” of the cdn.project.dev to the dev/wp-content/uploads
directory.
Putting the uploaded files outside of the wordpress directory tree,as the question literally asks, is not a great idea as it is likely to break all kinds of external tools like backup utilities.
Related Posts:
- How to decrease the max file upload size without using php.ini or htaccess?
- How to change upload directory in wp_handle_upload
- Uploading media with the REST API
- Decrease file size upload in Media
- Upgrading PHP version results in “Use of undefined constant WP_CONTENT_DIR” warning?
- Adding a custom image upload size and making it selected by default?
- Change the filename format of saved featured images
- Image Upload “exceeds the maximum upload size for this site”, but php.ini is correct
- How to register images uploaded via FTP in media library?
- Failed media upload: “The uploaded file was only partially uploaded.”
- Create Image Uploader for Widget
- Using file_exists to check file in Uploads
- How To Make Connection To WordPress Data Base In A Plugin?
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- Rename image uploads with width in filename
- Renaming wp-content folder dynamically
- Modify image while uploading
- Debugging upload problem: What part of WP does actual image-resizing?
- How to resize image on client-side before upload?
- Specified file failed upload test. wp_upload_handle
- How to upload imagick resource to media in wordpress
- Fix 403 error on WordPress multisite network using subdomains
- Accessing a random image via ajax
- Is it unsafe to put php in the /wp-content/uploads directory?
- Upload images and attachments from frontend form
- Notice: Constant already defined in wp-config.php on (non-existent) line?
- Image upload via FTP to wordpress media library
- WordPress media upload “HTTP error”
- Adding featured image via PHP
- How to enlarge the media file upload size in wordpress admin
- Restrict WordPress File Type Uploads by User Type
- No wp-config.php file on local install of wordpress – site still displays
- File upload, uploads only file name
- Modify Maximum upload file size text
- How can I change WordPress domain from remote to localhost?
- Why am I getting ERR_NAME_NOT_RESOLVED when I add a site to my multisite installation? [closed]
- Adding a querystring to an image URL when clicking ‘insert into post’?
- integrating external php library into wordpress- the right way
- Use WordPress’s Media Uploader/ Manager in non WordPress php application
- Upload a json file in php [closed]
- Custom image upload
- wp_handle_upload – The uploaded file could not be moved to wp-content/uploads/2012/09
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- Memory errors with media upload, WordPress can’t use more than 96M (while there’s 512 available!)
- Validate Uploaded Image using WordPress’ Built-in Functions?
- Get most recent media upload
- Force SSL using FORCE_SSL_ADMIN
- Change WordPress Upload Folder using wp handle upload
- How do I Import / Upload Files with jQuery AJAX?
- Redirect to another page using contact form 7? [closed]
- WordPress automatically adds links to uploaded images
- WordPress function when file is uploaded, deleted or edited
- Can I get an email notification when media is uploaded to the media library?
- How to add API security keys into JS of wordpress securely
- Moving wordpress site from localhost to live server using GoDaddy cPanel
- Blob file download problem
- What is the difference in the WP memory limits?
- zip unzip attachments in wordpress
- Upload multiple files in randomly generated folder using wp_upload_bits
- Set site title & tagline with wp.config or function.php
- Can’t upload CSV file to plugin directory using custom upload form in admin panel
- WordPress upload file size error even after raising php limits
- Get uploaded image and attach it to the new post
- Get featured image with custom size outside WordPress
- Why is my max_upload_filesize being limited to 2M? [duplicate]
- Images Uploaded saving onto older/previous year folders
- How do I increase the upload size only when editing special pages?
- Convert canvas to image and upload image to server
- How to get the filename from file system and create a download link?
- Get URL of Featured Image After wp_insert_post()
- Custom upload folder
- WordPress İmages Upload & Delete Error
- Allow user to Upload image and manipulate it on the frontend
- custom plugin with upload files does not work
- How to Make Thumbnail of Post Stay Animated
- Front end file upload returning wrong attachment url
- Convert all uploaded PNG files to PNG-8 format
- Some problems in custom widget
- Checking page before applying image restrictions while uploading
- Change image data durgin upload
- Hook on file upload
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- I can’t set image ad fatured programatically
- How can I update WordPress plugins or WordPress itself in all server?
- async upload not working when not logged
- WordPress loading all local images from specific directory?
- How can I redefine WordPress wp-content directory programmatically?
- Trying to generate a CSS file in wordpress uploads folder
- Site cannot access external connection
- Maximum file Upload
- Sudden Upload HTTP errors, PHP uploads and memory limits are already to high to my taste. Anything else?
- Change upload URL by mime type
- Right path for renaming a file in uploads folder
- Serve cookie free URLs in WordPress without using a CDN
- I want url from a file in media using title file
- Local WordPress from Git repo, where to set document root?
- WordPress file upload
- Upload images from one server to an other in wordpress
- Crop an image after upload on custom account page
- media_handle_upload fails with gravity form submitted image