WordPress.org

Ready to get started?Download WordPress

Forums

After moving site to new server, image uploads are all 404 (9 posts)

  1. Anointed
    Member
    Posted 3 months ago #

    Moved a website from one server to another server and everything seems correct with the exception of all uploaded images are showing as 404. Both servers run debian lamp.

    The website was using multisite at one time but that functionality was turned off via wp-config.php some time ago.

    This means that the uploaded files are stored in /wp-content/blogs.dir/1/.....

    I have checked all ownership and permissions on the files and they are correct. The htaccess file is the same as the old server etc.

    At this point I just need some other ideas as to where to look to fix this problem.

    Here is the .htaccess file contents, just in case....
    `
    RewriteEngine On
    RewriteRule ^(.*/)?\.svn/ - [F,L]
    ErrorDocument 403 "Access Forbidden"

    RewriteEngine On
    RewriteBase /

    #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>
    `

  2. bemdesign
    Member
    Posted 3 months ago #

    Did you run a find and replace across the database to make sure all the file paths in the DB have been updated to correctly reflect the move?

  3. Anointed
    Member
    Posted 3 months ago #

    @bemdesign no I didn't do that, first time hearing of it, I'll try to find a guide for changing paths in the db. Actually rather shocked that any of that would be stored in the db and not a config variable, but will check non the less... thanks for pointer

  4. bemdesign
    Member
    Posted 3 months ago #

    Well the site url and blog url are stored inside the database (under the options table). I'm just wondering if those haven't been updated they may cause a file path issue elsewhere on the site. It's worth checking for at any rate.

  5. Anointed
    Member
    Posted 3 months ago #

    @bemdesign
    Thanks, yes I checked the db and only the url is stored, no paths and that is correct as it didn't change.

    once again thanks for advice, I'll keep looking and post a solution when I get one.

  6. bemdesign
    Member
    Posted 3 months ago #

    Hmmm. No plugins for media that might save and serialize the filepath in the database? And it's not permissions? Same user accounts and file permissions?

  7. Anointed
    Member
    Posted 3 months ago #

    I'll keep looking, but no, the options table is clean, no paths displayed. permissions are set, owner/user account is www-data as normal for unbuntu. File permissions are correct as everything works except uploaded images, which do upload but don't display, thus leaving me with htaccess rewrite rules or other possible issues.

  8. omoscowonder
    Member
    Posted 3 months ago #

    have you checked your inner database as to any link related to your images been stored there?

  9. JumboClicks
    Member
    Posted 3 months ago #

    are you using any hotlink protection

    are you saying you can not directly access a file over http that you can navigate to by ftp and find its actual url?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.