• Resolved daricedotorg

    (@daricedotorg)


    I upgraded my single weblog site to 3.0-beta1 and enabled multi sites as I’m planning to create more weblogs in the future. It all went flawless, only problem is the path to upload media changed to “blogs.dir”.

    When I upload an image from my default weblog it won’t link correctly to the image path:

    <p><img src="https://www.mysite.org/files/2010/04/ziggo-speed.jpg" alt="Ziggo" title="Ziggo" class="alignnone size-full wp-image-1140" height="336" width="540"></p>

    The image is missing in my post preview.

    Secondly in the Media Libary all images links are broken.

    Is there a way to just default the uploads folder back to “uploads” like it was before enabling multi users?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    For what it’s worth, it ‘redirects’ images to the blogs.dir.

    My images too appear to be at https://www.mysite.org/files/2010/04/ziggo-speed.jpg BUT they redirect to the blogs.dir correctly.

    If I go to
    https://www.mysite.org/wp-content/blogs.dir/1/files/2010/04/ziggo-speed.jpg

    It still works. Are both those URLs working for you?

    Thread Starter daricedotorg

    (@daricedotorg)

    The first URL does not work for me, the second one does.

    I digged deeper in the settings and in Super Admin -> Sites -> Edit

    The upload path is the way I want it: /var/www/vhosts/mysite.org/httpdocs/wp-content/uploads, but when uploading from the the “Posts” editor it still goes to ‘blogs.dir’.

    Also “Media Library” still has all images broken…so either wise I have a setting wrong or it is a bug in WP3.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Firstly, no, you can’t switch the uploads path back to uploads. It’s just … yeah. Doesn’t work right.

    Secondly, I think your permalinks are ‘bad’. Your htaccess (for WPMU) is a bit more complex than for old WP.

    This is mine:

    # BEGIN WordPress
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress
    Thread Starter daricedotorg

    (@daricedotorg)

    Thanks, that was indeed the problem. Images uploaded after enabling MU do display in the Media Library. The ones uploaded before MU don’t, will have too look more into it.

    But the images do show up in my posts now so that’s solved! Thanks again.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The ones uploaded before MU don’t, will have too look more into it.

    I think, if you copy them up to the new location, they will.

    When I moved mine from regular to MS, I moved all the files from /uploads and put this in my .htaccess BEFORE the WordPress stuff.

    RedirectMatch 301 /wp-content/uploads/(.*)$ https://www.mysite.org/files/$1

    That said ‘Everything you think is in uploads is in files, let WordPress sort it out.’

    Thread Starter daricedotorg

    (@daricedotorg)

    Thanks! I will try that.

    Thread Starter daricedotorg

    (@daricedotorg)

    That solved the problem, thanks.

    I was having this problem as well and this fixed it – thanks for the info! You saved me a lot of headache ^_^

    Hey everyone, I am having the same problem when I switched my single user blog over to WordPress 3.0

    I have 6 additional blogs being set up on the network as we speak, however we are unable to load any images to the posts. I went into my htaccess file which is in my htdocs root folder. I replaced the text that was there with the text Ipsentu posted above:

    # BEGIN WordPress

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress

    After doing this I still am unable to load images into the post window. When we do upload an image it appears as broken. PLEASE HELP!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Did you put this bit in as well, before the WordPress section:

    RedirectMatch 301 /wp-content/uploads/(.*)$ https://www.mysite.org/files/$1

    Also, check your site settings at Super Admin -> Sites -> Edit (for the site) and see what the uploads directory is set to.

    I found another one of your posts from about a month ago and you said to use this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>

    I used the above and I also checked my upload path like you said. I changed that path to the same path as my main blog. Now the pictures are loading perfectly. Should every new site that is created on my network have the same URL path as my main site (…/wpcontent/uploads) ?

    I love WordPress! Honestly, I love it. And I love the people that are involved with WordPress. A real community. Thank you for responding to my post just 2 hours after I made it. I am interested in developing my own theme, any suggestions for reading/researching tips?

    Dan

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The if module wrapping is the only diff between the two code blocks there for .htaccess – They’re the same and they ARE the MultiSite defaults ??

    I changed that path to the same path as my main blog. Now the pictures are loading perfectly. Should every new site that is created on my network have the same URL path as my main site (…/wpcontent/uploads) ?

    Actually, the goal is to change from wp-content/uploads to wp-content/blogs.dir/<blognum>/files

    For Blog #1, change it back to wp-content/blogs.dir/1/files

    Copy all the folders from wp-content/uploads into wp-content/blogs.dir/1/files so you get wp-content/blogs.dir/1/files/2010/01/file.jpg and so on.

    Then put this ABOVE that WordPress block in your .htaccess:
    RedirectMatch 301 /wp-content/uploads/(.*)$ https://www.mysite.org/files/$1

    This will tell your blog that wp-content/uploads is really /files, which that big code block will correctly parse for you.

    I know it sounds weird, but the idea is to have a separate upload folder per blog, and we have to adapt your old site (which used the uploads folder) to ‘learn’ the new location.

    Then put this ABOVE that WordPress block in your .htaccess:
    RedirectMatch 301 /wp-content/uploads/(.*)$ https://www.mysite.org/files/$1

    above you say to insert…https://www.mysite.org/files/$1 above the wordpress block in htaccess. what is “the wordpress block”. also, where you say “mysite.org”, would i insert moxietoday.com (my website domain name is moxietoday.com)?

    I am sorry for asking so many questions, I am just trying to learn.

    now all my images are not working on my main site. here’s what my .htaccess file looks like:

    <IfModule mod_rewrite.c>

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # uploaded files
    RedirectMatch 301 /wp-content/uploads/(.*)$ https://www.moxietoday.com/files/$1
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    </IfModule>

    my upload path in the super admin > sites > edit is ….

    wp-content/blogs.dir/1/files/

    Any help is much appreciated.

    RedirectMatch 301 /wp-content/uploads/(.*)$ https://up.mysite.com/files/$1 ?

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Uploads folder location from single to multiple sites’ is closed to new replies.