• i want to change the default directory of uploads i.e ” wp-content/uploads “
    i want to set it to ” xyz.com/media “

    I used UPLOADS constant in wp-config and it is changing the url of the uploaded media but the media is not found on the server or you can say it was not uploaded in that directory…

    Kindly tell me how can i change the uploads directory in WP 4.1

Viewing 10 replies - 1 through 10 (of 10 total)
  • jack randall

    (@theotherlebowski)

    Tim Nash

    (@tnash)

    Spam hunter

    Just to make sure you are doing something like:

    define( 'UPLOADS', 'uploads/' );

    and the folder path is correct, and all the directories prior to the folder exist and it’s web accessible?

    Be careful when adding paths, putting a / at the start can radically change the final location if in doubt set to a full path.

    Also, if you already have media uploaded, I don’t think WordPress will move the files on the server for you, so after changing the constant, you will need to move your files to the new location.

    Thread Starter Mubbi Qureshi

    (@mubbi_qureshi)

    jack randall and Tim Nash i have tried these codes but when i open the files it says 404 not found!!!

    and Ryan u r not understanding my question!

    OK, let’s say you run WordPress 4.1 and upload a picture. After you upload it, you can view the file at something like:

    example.org/wp-content/uploads/2014/12/picture.png

    And let’s say you now change the uploads folder location via:

    define('UPLOADS', 'wp-content/media');

    This will give you a URL like this:

    example.org/wp-content/media/2014/12/picture.png

    Your previously uploaded picture would not be found, because while you’ve updated the path, the actual picture still lives at the old location (wp-content/uploads) on the server.

    This would be the problem you are having, unless you don’t have any previously uploaded media.

    Can you upload an image before setting the constant and after setting the constant, and then let us know when what image loads by trying it with and without the constant? Maybe you can also post the path of the URLs here so we can compare them.

    Thread Starter Mubbi Qureshi

    (@mubbi_qureshi)

    Thanks ryan for understanding the proper issue. the example urls before and after u given are not correct! when i upload a new media(after constant) on the website the url becomes (example.org/media/2014/12/picture.png) but when i open this link then 404 error is shown to me !

    So, after changing the UPLOADS constant and uploading a file, you don’t see a thumbnail in the media gallery either, right? Also, can you confirm this does work prior to changing it (and it’s not a upload issue in general)?

    Can you FTP into the server and see if the file exists at /media/2014/12/picture.png? I’m trying to determine if the file physically does not exist or if there is maybe some rewrite in place.

    Thread Starter Mubbi Qureshi

    (@mubbi_qureshi)

    physically image exist in the media directory! but when i open the url it gives me 404 error

    This is not natural behavior from what I can tell, so something else is preventing this from working. It could be a server-side rule (in Apache, for example) or something in your htaccess file.

    I setup a brand new WordPress install, uploaded an image, and it displayed as expected in the media gallery. I changed the upload path, the existing image thumbnail could not be loaded (since I didn’t physically move the file), and after I uploaded a second image, I could visit example.org/media/2014/29/picture.jpg.

    To determine whether there is an issue with your current WordPress installation or whether it’s a configuration issue on your server, can you setup a clean WordPress installation (version 4.1) and try what I tried, to see if you get the same result?

    Thread Starter Mubbi Qureshi

    (@mubbi_qureshi)

    ohk thanks ryan ?? (Y)

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Change Uploads Directory In WP 4.1’ is closed to new replies.