Media url (8 posts)

  1. zebrastribe
    Posted 2 years ago #


    I have an small problem. I have an old install of wp that I have export into a new one – both are 3.7.1 versions.

    The links on the old install is:

    But on the new install it is

    How do I make the:


  2. Yeah, that's expected. In WP 3.5 and up, images are in /uploads/sites/ and not /blogs.dir/

    Don't try to make the urls /files/, do a search/replace and change it to sites/2 instead.

  3. zebrastribe
    Posted 2 years ago #

    Hi Mika

    Thank you for your reply. I understand that the new way of placing the files is in the "uploads"-folder and I have no problem with the files being there but I would really like to have the url for the visitor as clean as possible and not include the wp-content/uploads/sites/ or /blogs.dir/


    Can I be done?

    If I understand you correctly you are talking about updating the database from "/files/" to "sites/2", right?

    Then the url will look like:

    Can the "wp-content/uploads/sites/" part be just f.ex "media"?
    As I have seen the in roots.oi theme?

  4. Can? Yes. But you're into custom design land. You would have to reverse engineer the ms-files.php calls from older WPs to do this, and frankly, you're on your own.

    The reason the /files/ call was dropped was that it doesn't work on all servers, it's slower, and it causes loopback issues. We don't support or recommend a NEW install use it.

  5. zebrastribe
    Posted 2 years ago #

    Hi Mika

    Ok. The custom land is not the way for me...

    Why does the old install exclude the "wp-content/blogs.dir/2/" from visitors url?
    when the new install does not hide the "wp-content/uploads/sites/2/?

    I guess I hoped that there were some magic htaccess rewrite rule that could make it work...

    Instead of having to relay on this plugin:


  6. http://codex.wordpress.org/Multisite_Network_Administration#Uploaded_File_Path

    ms-files.php used to parse the URL by using the complex .htaccess redirect. So it went htaccess -> ms-files.php -> image. And that's a probelm on a lot of servers :/

    But ... Nobody cares if you're using WP. I mean, realistically, you can hide it all you want, and I can STILL find out in about a minute, while drinking a beer. Brute Force attacks don't care. They'll still hammer you. Targeted attacks because you ticked someone off won't change either. It's a waste of my time and my server's CPU to bother.

  7. zebrastribe
    Posted 2 years ago #

    ok. I see you point and thank you for explanation, sorry for my ignorance...

    Which is the best procedure for updating the links inside the post?

    Because now the new images are placed into "wp-content/uploads/sites/2/" and the old are with the "/files/" (which is in the "wp-content/uploads/sites/2/" folder)

    At the moment the old is on domain.com and the new is on sub.domain.com but when all is up and running I will make the switch.

    You talk about search/replace?

  8. I recommend this: https://github.com/interconnectit/Search-Replace-DB

    it's not WordPress, it's a separate script, but it's absolutely the best thing.

    In your case, you'll search for the WHOLE PATH for the images.

    However if you're concerned about accidently getting other tables, then you want to ONLY search the wp_2_posts table.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.