I am trying to define the wordpress upload folder outside the installation directory. My directory structure is:
|-> wordpress (the wordpress installation)
|-> uploads (the required upload folder)
I have tried defining the 'UPLOADS' in my wp-config.php like:
Wordpress creates the folder and the images are uploaded there, but cannot use it when required. The image URL looks like :
But if I use absolute path to define the 'UPLOADS' like
But the problem is, then the image url looks something like:
This tells the location of the file and this can be a security issue.
So, is there a better way to define the relative path for the uploads folder which will point to my required folder?
Thanks in advance.
If you take a look at this link http://www.wpbeginner.com/wp-tutorials/how-to-change-the-default-media-upload-location-in-wordpress-3-5/
You need to use a path like so
define( 'UPLOADS', ''.'uploads' );
I have done it at last by making a symlink with proper permissions. In my case, when I tried to make a symlink, the symlink did not have enough permission to write into the folder. This was because of my system (I am using Macbook). So what I did is:
$ cd wp-content $ mv uploads /path/to/my/base/folder/ $ ln -s ../../uploads uploads $ chmod -h 777 uploads
Check the last line where I have changed the permission for the symlink. Normally in most of the cases, you don't need to change the permission of the symlink, as they inherit the permission of the folder.