• Resolved kingkong954

    (@kingkong954)


    We are in the process of migrating an existing WP 3.01 multisite install with sub-domains to a new server environment.

    The issue I am having is that ms-files.php doesn’t seem able to fully serve an image.

    Some scenarios:

    1) If I access the image directly, it works fine. e.g. http://domain/wp-content/blogs.dir/1/files/2010/11/image.jpg

    Here are the response headers I receive for this URL:

    Date: Sat, 20 Nov 2010 00:44:25 GMT
    Server: Apache/2.2.3 (Red Hat)
    Last-Modified: Fri, 19 Nov 2010 22:13:37 GMT
    Etag: "6bd5e-1cde0-4956f37ce0640"
    Accept-Ranges: bytes
    Content-Length: 118240
    Content-Type: image/jpeg
    
    200 OK

    2) If I try to use the URL as the WP media library has it, I get a missing image icon/result in my web browser. e.g. http://domain/files/2010/11/image.jpg

    Here are the response headers I receive for this URL:

    Date: Sat, 20 Nov 2010 00:42:24 GMT
    Server: Apache/2.2.3 (Red Hat)
    X-Powered-By: PHP/5.1.6
    Content-Length: 118240
    Last-Modified: Fri, 19 Nov 2010 22:13:37 GMT
    Etag: "1d43e654a64ff413bc8a5520d4af253a"
    Expires: Mon, 20 Jan 2014 10:29:04 GMT
    Connection: close
    Content-Type: image/jpeg
    
    200 OK

Viewing 7 replies - 1 through 7 (of 7 total)
  • Did you migrate over the .htaccess file? It’s hidden so it often gets missed in a transfer.

    And this is what controls the image rewriting.

    Thread Starter kingkong954

    (@kingkong954)

    Hi Andrea,

    It’s most definitely moved over. I tried to do some research about this, and have thrown a few hours at it already. I’ve seen examples of others with similar problems, but their solutions have not worked so far.

    Also normal ‘pretty’ permalinks work for posts and pages. It seems most also had the issue of having broken permalinks, but not me.

    Here is my .htaccess file:

    # BEGIN WordPress
    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

    So you have a subdomain install?

    Thread Starter kingkong954

    (@kingkong954)

    Yes

    Thread Starter kingkong954

    (@kingkong954)

    Any ideas?

    Debugging ms-files.php, it appears it is successfully reaching the end where it actually sends the file via readfile ($file), but the browser never seems to actually receive anything.

    PHP error logs are empty, as well

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Are you using any caching software? Like w3tc or wpsc?

    Thread Starter kingkong954

    (@kingkong954)

    wow… it’s fixed, and I feel like an idiot.

    I had extra return lines in wp-config.php after the final ?>

    They were somehow inserted during the transferring of files between servers.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘ms-files.php not actually serving images?’ is closed to new replies.