Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#13564 closed defect (bug) (invalid)

MU - Images not displaying

Reported by: thevegastourist's profile thevegastourist Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Multisite Keywords: image upload
Focuses: multisite Cc:

Description

Images not showing up in post

Using the same image for testing purposes.

On the main site, the image shows perfect.

On this site
http://www.thevegastourist.net/

Posted the same image on a second site
http://www.thevegastourist.net/reviews/

I get a blank box.
The post shows the image location as
http://www.thevegastourist.net/reviews/files/2010/05/stevetrace.jpg

When it really is at
http://www.thevegastourist.net/reviews/wp-content/blogs.dir/2/files/2010/05/stevetrace.jpg

version (3.0-beta2-14896)

Change History (4)

#1 @nacin
15 years ago

  • Milestone 3.0 deleted
  • Priority changed from high to normal
  • Resolution set to invalid
  • Status changed from new to closed

MU dynamically serves uploads through a /files/ directory. You need to have htaccess (or web.config, etc.) rules which rewrites those requests to the wp-includes/ms-files.php handler.

#2 @thevegastourist
15 years ago

  • Cc thevegastourist added
  • Resolution invalid deleted
  • Status changed from closed to reopened

Here is my .htaccess file.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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

The .htaccess file is as requested by others on trac,
What new needs to be added or changed?

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

#3 @nacin
15 years ago

You likely have something messing up with your output then, such as a plugin that spits out whitespace perhaps?

#4 @wpmuguru
15 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

There are 3 bogus bytes at the beginning of the image file. You have a plugin or something on your server that is inserting those at the beginning of the output of the file.

Note: See TracTickets for help on using tickets.