Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've just installed a fresh copy of Wordpress 3.8.1, and then enabled the network feature using sub-domains.

In cPanel, I have the wildcard sub-domain pointing to the Wordpress folder, and Wordpress admin is working fine in the sub-domain.

When I am in a sub-domain's admin area, and I try to add an image to a page, the image displays as a broken placeholder.

However, I can see it has been uploaded to /wp-content/uploads/sites/2/2014/03/*.jpg

Here is my .htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteRule ^.*/files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L] 

Can you see what is wrong?

Here are some example images that will not display in the browser, even though they are in the file system:

Here are some that do work:

share|improve this question
2  
Are the images themselves broken or are the links to the images broken? –  s_ha_dum Apr 3 at 9:06
    
@s_ha_dum: The links to the images are broken. –  Steve Apr 4 at 7:21
    
What are the URLs? Maybe there is a clue. –  s_ha_dum Apr 4 at 14:25
    
@s_ha_dum: I've added a URL that does and doesn't work. –  Steve Apr 7 at 3:46

1 Answer 1

I don't use MU and I can't test this right now but...

If you started with a fresh 3.8.1, then your .htaccess file should look like this (per the Codex):

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ wp/$1 [L]
RewriteRule . index.php [L]

Your .htaccess doesn't match, notably this line:

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

That line is missing in the canonical file but included in yours. It is similar to a line from the WordPress 3.0 through 3.4.2 sub-folder example, but not an exact match:

RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

And also similar to the WordPress 3.0 through 3.4.2 subdomain example, but not an exact match to that either:

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

Either way, you appear to have a not-quite-correct legacy rewrite rule in your .htaccess file.

That said, I don't think that rule should get in the way, though it makes me wonder how it got there.

I do notice that the sites/ directory 404s (HttpFox output):

GET 404 text/html http://nsw.findrhinoplasty.com.au/wp-content/uploads/sites/

That makes me suspect a permissions problem on that directory or a parent.

share|improve this answer
    
I tried replacing .htaccess with the copy above, but the issue remains. –  Steve Apr 10 at 0:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.