WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] All images are disappeared after upgrade to 3.0.1 (32 posts)

  1. tqeadmin
    Member
    Posted 3 years ago #

    Hello, Experts!

    Few weeks ago, I upgraded WP mu for the websites that I am developing based on WP mu. After upgrading, I got the following message.

    "The wp-content/blogs.php file is deprecated. Please remove it and update your server rewrite rules to use wp-includes/ms-files.php instead."

    So, as the message says, I removed wp-content/blogs.php file and rewrote rules to use wp-includes/ms-files.php in the "htaccess file", as many people suggested. But, when I did that, all images that I have uploaded were gone. So, I reverted blogs.php file, then the images are appeared again.

    My main concern with the error message is that the WordPress sites that I'm handling aren’t working like they should— I’m afraid that if I update the sites and a newer version of WordPress is released, I will be still stuck trying to figure out the problems with the older version and won’t be able to move forward.

    Do you guys have any idea to fix this issue?
    I look forward to hear any suggestions.

    Thanks in advance.

  2. Did you also update your .htaccess file?

    Read this post: http://wpmututorials.com/how-to/upgrading-from-wpmu-to-wp-3-0/

  3. and rewrote rules to use wp-includes/ms-files.php in the "htaccess file",

    Some people are making typos and not changing the original wp-content to wp-includes. Double-check.

  4. tqeadmin
    Member
    Posted 3 years ago #

    Thank you for your replies...
    @ipstene: Sure, I updated htaccess file as the post suggested before I post this thread. But, after updating htaccess file, the images are still not showing.. That's why I asked about the issue here.

    @Andrea_r: I checked several times, but I couldn't find any typos.. :(

    Thanks for your replies again. Do you have any other idea?

  5. tqeadmin
    Member
    Posted 3 years ago #

    I did once again what you suggested.
    The steps that I did were;

    1) rename blogs.php to 0blogs.php instead of removing.
    2) add a nonce salt to wp-config.php as the warning message said
    3) edit the rewrite rule in htaccess file.

    After I did all steps, the message was gone.
    But, the images that I have uploaded to the sites also disappeared.

    So, when I reverted the file name blogs.php from 0blogs.php, the images were shown again even though I didn't revert the htaccess file.

    Please help me the issue, disappearing images after removing blogs.php file.

    Thanks in advance.

  6. What's the full content of your .htaccess?

  7. tqeadmin
    Member
    Posted 3 years ago #

    This is my .htaccess
    -----------------
    RewriteEngine On
    RewriteBase BASE/

    #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-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
    ------------

    Thanks

  8. Yeah, that's not quite right. Read this link and set it more like this (depending in if you're subfolder or subdomain).

    http://codex.wordpress.org/Create_A_Network#.htaccess_and_Mod_Rewrite

  9. tqeadmin
    Member
    Posted 3 years ago #

    Thanks for your quick reply.

    BTW, what I did when I edit htaccess file was to change the part, "wp-contents/blogs.php" to "wp-includes/ms-files.php" in the following line.

    I mean before I change the line, it was;
    RewriteRule ^(.*/)?files/(.*) wp-contents/blogs.php?file=$2 [L]

    After I edited, it became;
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

    So, do you mean I have to change more?
    But, I'm sorry but I don't know how to change the line.. even if I read the post you linked several times.

    Could you teach me a little bit more? If you need to see more about my sites to help me, I can give you more information about the sites.

    Thanks a lot.

  10. So, when I reverted the file name blogs.php from 0blogs.php, the images were shown again even though I didn't revert the htaccess file.

    Okay, this is helpful - make sure when you upgraded it actually did get all the files. Because really, even though it says to REMOVE that file (not rename it) it sounds like it's missing the call to the new file.

    Go check in wp-includes/ and see if ms-files.php is actually there.

  11. What andrea said, plus your .htaccess is probably still workable, BUT it's less efficient and makes more calls than are needed. And when that happens, things can sometimes go wiggy. Upgrading from MU should ONLY require that one line change, but that said, a couple of those lines look like they could cause .htaccess collisions. Like I see multiple lines telling /files/ where to go.

    Once you're sure the ms-files.php file is there, we can play with .htaccess.

    If you're using SubDomains, use this:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /BASE/
    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
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    SubFOLDERS:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /BASE/
    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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>
  12. tqeadmin
    Member
    Posted 3 years ago #

    I really appreciate your kind replies.

    @Andrea_r: Yes, there IS the file ms-files.php in the wp-include folder

    @ipstenu: I tried both of the codes you posted even though I'm using subfolder for WP. However, both didn't work. Whenever I removed blogs.php from wp-content folder, the images are all gone. Only when there is the blogs.php file in the wp-contents folder, the images are showing. What should I do?

    Thank you very much and sorry for the bad news although both of you are helping me a lot.

  13. I'd do a manual re-upload of all of the WordPress 3.0.1 files. It's possible some other ones are missed.

    Then use JUST the subfolder .htaccess (and no other!).

  14. tqeadmin
    Member
    Posted 3 years ago #

    Yes, that is what I did. I copied the codes for only subfolder.
    I see, I will do a manual re-upload of all of the word press 3.0.1 files.
    Thanks.

  15. When you said you tried BOTH codes, I wanted to be pedantic and make sure ;)

  16. "
    RewriteBase BASE/"

    this is incorrect. If you're installed in the ROOT it should be
    RewriteBase /.

    Are you sure you're editing the right htaccess file? If you're not even calling blogs.php in the rewrites, there's no way it should logically even be looking at it. none. It's called nowhere else in any of the 3.0+ files.

    And when Ipstenu gives new htacess rules, they are to *replace* what you have. Not add to.

  17. BRAIN WAVE:

    Are you editing .htaccess or htaccess.DIST?

    the second one will not work. it is NOT USED.

  18. tqeadmin
    Member
    Posted 3 years ago #

    I have been editing htaccess.DIST..

    Where can I find .htaccess?

  19. Points to Andrea!

    You have to create .htaccess :) It's a file that is, literally, named .htaccess (just the . and the htaccess)

    It's a hidden file so you may have to turn on show hidden files on your FTP tool. You can rename htaccess.DIST to .htaccess in there.

  20. tqeadmin
    Member
    Posted 3 years ago #

    You guys may not know how much I thank you.
    As you suggested, I edited .htaccess file, not htaccess.DIST file.
    Yes, I replaced all lines as ipstenu suggested.

    However, when I removed the blogs.php file, the images disappeared again.
    For your information, the folder that WP is installed is not root folder. It is the sub-folder named "specialty"
    So, the line that Andrea mentioned is not "RewriteBase /specialty/"

    The following is the code before I edited.

    RewriteEngine On
    RewriteBase /specialty/
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.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-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    I changed above lines with

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /specialty/
    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).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    But, as I told you, it is not working either.
    I don't know what else I should do. :(
    Sorry for another bad news, but I really appreciate you guys a lot.
    If there is any others that I can try, please let me know.

  21. Where's the .htaccess file? It should be in that /speciality/ folder.

  22. tqeadmin
    Member
    Posted 3 years ago #

    yes, it was in /specialty/ folder. And I found it after I turned on the show hidden file function in my ftp program.

  23. tqeadmin
    Member
    Posted 3 years ago #

    And, I uploaded it after edit to the /specialty/ folder.

  24. When you upgraded, how did you do it? Manually or auto-upgrade?

    Because as I said above, after a proper upgrade, literally *nothing* calls that blogs.php any more. removing, renaming, whatever - should have literally no effect.

    And, I uploaded it after edit to the /specialty/ folder.

    edit it right on the server.

  25. tqeadmin
    Member
    Posted 3 years ago #

    @Andrea_r: FYI, I upgraded manually due to other errors that I met when I tried auto-upgrade. What I did was, therefore, to download the newest version of WP, and to overwrite all files into the folder that contains previous WP version files. Then, I could see some regular error message in dashboard, for example, adding Nonce_Salt line to config file, and removing blogs.php file and rewriting the rule as I posted through this thread. And I fully followed the systems' suggestions and what I got finally was the symptom that all images are gone.

    Thank you very much for your efforts to help me, but after all, I decided to reinstall, not update, the newest version of WP. I don't know if it is good choice, but, I think, if I make the website from the beginning based on the newest version of WP, it will take less time than the amount of time that I will spend to solve the issue.

    I really appreciate you guys again.
    I hope everything you are doing goes well.

  26. If there's not a lot of content to port over, then yeah. that works too.

  27. tqeadmin
    Member
    Posted 3 years ago #

    Hi again.
    I downloaded the newest version of WP, WP 3.0.1 from the official website.
    Before install and test it, I installed it my laptop that can be used as a server. I installed apache and mySQL in my laptop, FYI
    To make it muli-site WP, I touched config file and then I could see the 'network'menu in the tools menu.

    After that, when I tried to edit .htaccess file as the system suggested, I couldn't find the file named .htaccess in the installed WP folder although I turned on the function to see the hidden files.

    So, I made .htaccess file and saved it, then the site showed the following error message.

    Server error!

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

    If you think this is a server error, please contact the webmaster.

    What should I do to solve the issue? Do you have any idea?

  28. Make sure mod_rewrite is enabled in apache.

  29. tqeadmin
    Member
    Posted 3 years ago #

    @Andrea_r: Thank you so much. now it is working, and the image disappearing issue also solved. I appreciate you and ipstenu a lot.

    But I have another problem. When I try to update theme, I got following error. Could you help me again?

    Downloading update from http://www.genesistheme.com/download/?file=genesis.1.4.zip…

    Unpacking the update…

    Installing the latest version…

    Removing the old version of the theme…

    Could not remove the old theme.

    Theme upgrade failed.

    Thanks in advance.

  30. Delete the contents of wp-content/upgrades and try again.

    If that fails, just do it manually. Sometimes the auto installs get hinky.

    (and generally open a new topic for a new issue ;) )

Topic Closed

This topic has been closed to new replies.

About this Topic