WordPress.org

Ready to get started?Download WordPress

Forums

Image links broken un WordPress 3.0 subdomain (12 posts)

  1. teo7
    Member
    Posted 4 years ago #

    Hello all. I upgraded from WordPress 2.9.2 to WordPress 3.0. Enabled multisites with the subdomain option. Created my first subdomain and all works fine. The problem is that when I upload images, they are uploaded to blogs.dir, but they aren't displayed. I read that this should be solved with the following code in my httpd.conf file:

    <Directory>
        Options FollowSymLinks
        AllowOverride All
    </Directory>

    Still not working. I let you the my .htaccess content:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    
    #Wordpress Multi site
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    #END WordPress Multi Site

    I have my own server running CentOS and Plesk 9

  2. greene.md
    Member
    Posted 4 years ago #

    I'm having the same problem but from a straight 3.0 build - no upgrade. I hope someone can help solve the problem soon...

  3. This is the relevant rewrite rule

    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    which is correct. :)

    You may need AllowOverride FileInfo Options in the vhost for that particular web account.

  4. teo7
    Member
    Posted 4 years ago #

    Andrea, thanks for your answer, but it's still not working. I have my own server running CentOS and Plesk 9. Do I need change something in other file additionally to httpd.conf?

  5. teo7
    Member
    Posted 4 years ago #

    SOLVED!!!!!

    After check my .htaccess content I decided delete the content within #WordPress, because it's basically the same thing. I was thinking there could be a conflict and I was right. After delete that code I was able to see the images uploaded to my subdomain site. Now my htaccess looks like this:

    #Wordpress Multi site
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    #END WordPress Multi Site

    Remember, in httpd.conf you need:

    <Directory>
        Options FollowSymLinks
        AllowOverride All
    </Directory>

    This solves the problem and don't forget to clear browser's cache after each change you make :P.

  6. gazouteast
    Member
    Posted 3 years ago #

    @teo

    I have my own server running CentOS and Plesk 9

    Are you having any issues accessing fixed name sub-domains / hosts directly with WP 3.0 multisite working properly?
    e.g. if you go to webmail.yourdomain.com does it throw you at the wordpress homepage, or give you the webmail login screen?

    One of my hosting services would be very interested in your answer.

  7. blogsterfiles
    Member
    Posted 3 years ago #

    This has been a pox on my existence. I believe this problem IS a WordPress BUG!! I finally got my programmer to look at the problem and all these posts this morning. He worked on the blog for about an hour and now everything is working. He laughed when I said people here are saying it is not a WP bug. In any event, this is what he sent me and it is now finally working:

    The problem is in the wp-includes/ms-files.php

    1. Put double quotes into the header function on line (41ish)
    Original: header('Content-type: ' . $mimetype ); // always send this
    Fixed: header('"'. 'Content-type: ' . $mimetype .'"'); // always send this

    2. Call ob_clean before the readfile on the last line:
    ob_clean();
    readfile( $file );

  8. there's already a trac ticket since the OP. (and note others say it worked for them without a bug fix, so it's not across all servers in all cases. hard to pin down that way.).

  9. blogsterfiles
    Member
    Posted 3 years ago #

    @Andrea_r People are drawn to WordPress like flies to honey because it's great; open source, free of purchase cost, incredibly adaptable to the needs of many, and is supported by great people such as yourself whom give freely of their time helping others. The image problems that arise for some when creating a network in 3.x are varied, as are the fixes. I think everyone knows by now that most problems are caused by folks just not following instructions, while some need proper deployment of server settings, tweaking of .htaccess and httpd.conf (vhost.conf on Media Temple), etc.

    When I talked to my computer guy this morning, he scolded me (again) for using WP at all. He thinks it's a bad deal. You on the other hand think I shouldn't be here because it's complex and I don't know enough to deal with it. You are right, but in Pirates of the Caribbean, when Jack Sparrow was accused of lying or stealing, his only defense was to utter the word, "Pirate". My answer to all objections to me or anyone using WP for any reason is (in the spirit of Jack Sparrow), "Honey"!

    After all is said and done, it appears the cure on my Media Temple VPS was in WordPress code (ms-files.php) and not in my server or failure on my part to follow instructions. To narrow the trouble, I was working with a bare-bones, spanking-new install of 3.0.1. Now that I am past this monstrous image roadblock, I am in the process of testing Buddypress and various plugins. If anyone is interested, let me know and I'll gladly share whatever I learn. In the mean time, whether it's across all servers or not, it bites, itches, and requires scratching, so I'm calling it a bug. :)

    Never give in. Never give in. Never, never, never, never--in nothing, great or small, large or petty--never give in, except to convictions of honor and good sense. ~Winston Churchill 1941

  10. Dang, and I am on team pirate as well (andrea arrrrrr - get it? :D )

    this thread was started a month ago, and in open source the code form a month ago may not be today's code, so yeah - bugs get in! :D

  11. blogsterfiles
    Member
    Posted 3 years ago #

    LOL...yep I get it. :) You gave me a great clue too pirate girl. I still ran into a bit of trouble today. After my earlier fix (step 1 & 2 above) images displayed great in the gallery and in posts but they rendered as txt instead of images whenever I drilled down to the generated sub-domain image URLs. So I went to wordpress trac and read and read. I found two other lines of code that did what my edit had done so I copied the entire contents of the ms-file.php (Changeset 15473) and pasted it into my test sites ms-files.php. Images still did not show, so I added ob_clean(); near the bottom, just above readfile( $file ); (same as step 2 from above) ...and VOILA!!! I now have what seems to be a fully functional WP 3.0.1 multi-site on my Media Temple VPS! A caveat for bystanders though, I'm just thrashing around in the dark so I don't recommend anyone follow my meager efforts, however, perhaps you can do something with this info or pass it along where it might do some good. Whew...glad to put this one to bed. Thanks for sticking with me. :)

  12. Just to drive us all crazy - I took my test site, which was subdomains, and reverted it to a subfolder install.

    After a brief stint of having to add a couple lines to my htaccess file, guess what? It worked fine.

    Yes, it's 3.0.1.
    no, I didn't wrangle a thing on the server (tho it is the default domain on its own IP).

Topic Closed

This topic has been closed to new replies.

About this Topic