WordPress.org

Ready to get started?Download WordPress

Forums

Images don't show (17 posts)

  1. davewarnerrecorder
    Member
    Posted 3 years ago #

    OK, I've read a ton of posts and still cannot figure out how to get images to SHOW in a sub domain blog. They show in the main blog fine. If you have a subdomain blog, they upload fine and never show in the post. A broken image appears. The actual file is in the files/subdirectory for the site. Yes the AllowOverride File Info stuff is set in the conf file. I looked at so many htaccess files, I no longer have a clue as to what is correct and what isn't. So, here is mine:

    RewriteEngine On
    RewriteBase /

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

    Main site is http://www.weeklyexpressnews.com sample subdomain site is http://www.bremondhouse.com. The image that is in the about section is hard-coded to the main domain images directory in order for it to work (first one). Second one at the end of the about section has been uploaded and inserted within the page post. It doesn't show. The link to it brings up a 'No input file specified' error in Firefox.

    Help?

  2. You upgraded from WPMU 2.9.x and didn't edit the .htaccess correctly.

    Try this:

    # 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]
    
    # 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. davewarnerrecorder
    Member
    Posted 3 years ago #

    It was a fresh install, not an upgrade. But, that file is up there - no change!

  4. But, that file is up there - no change!

    You mean you changed your .htaccess to what I suggested? Sorry, I just want to be clear you're not trying to say that your .htaccess (posted above) is the same as the one I posted :)

    I know you have some multi-domain plugin in use, but did you setup WordPress to install new blogs as subdomains or subfolders?

  5. davewarnerrecorder
    Member
    Posted 3 years ago #

    Sorry - I should have said - yes, I used yours exactly as is and I set it up to install new blogs as subdomains.

  6. Ah, okay, try this instead:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    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]
    </IfModule>
    # END WordPress
  7. davewarnerrecorder
    Member
    Posted 3 years ago #

    Well, that one is up there and we have progressed to the following error when you view source on the page and click on the last image URL:

    404 — File not found.

    The file is up there for sure.

  8. You lost me there. View source and THEN click on the last image? I might need to see this one to grok.

  9. ciceronedotro
    Member
    Posted 3 years ago #

    In .htaccess I replaced the line

    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    with

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

    and it's ok now with the URLs like:
    your-mu-wordpress-blog.com/files/2010/09/filename.jpg

    Thank you ipstenu

  10. ciceronedotro, yeah, that's always a requirement and, for upgrades, you should have been told to do so.

    The blogs.php line is from OLD WPMU, so the only way to get that is to install 2.9.2 (or whatever) of WPMU and upgrade to 3.0 :)

  11. davewarnerrecorder
    Member
    Posted 3 years ago #

    ipstenu

    Seems like your last iteration worked. What I meant (above) was that I had put two images in that post. One hard-coded to the root website and the other inserted the normal way into a child subdomain site at the end of that page. The second one would not show. However, today on ANOTHER child subdomain site, I was able to upload a graphic. AND, when I went back to http://www.bremondhouse.com, I was able to upload a new graphic to the site and have it show, but NOT an old one that was already up there.

    I didn't take the last two changes (ms-files.php versus blog.dir).

  12. davewarnerrecorder - Cool! Okay, I get it :)

    The reason the second .htaccess works is b/c there is a difference between subdomains and subfolders .htaccess config. The install process SHOULD have told you which one, and I'm stymied as to why it had you put in blogs.php in yours. But bygones. Fixed one, don't care.

    Are old images failing to show? And can you link to a post where the problem is happening? We may need to do some .htaccess trickery with redirects for you.

  13. davewarnerrecorder
    Member
    Posted 3 years ago #

    I don't know. Anyway, like you say - fixed is good! Look at http://www.bremondhouse.com/about/ There is one image that shows and one that doesn't (when you search the code). The second one is an old image, the first is hard-coded from the root mu site images directory. Not a big deal, but I put it back in there to show you. On the htaccess - does that only reside in the root, or should it be in another directory as well?

  14. .htaccess JUST in root.

    Did you upgrade from an old version of WordPress or WPMU perchance?

    Anyway.

    Broken: http://www.bremondhouse.com/files/2010/07/10-24-02-005_deb1.jpg
    Works: http://www.weeklyexpressnews.com/images/10-24-02-005_deb.jpg

    Okay!

    The broken link should be redirected to this:
    http://www.bremondhouse.com/wp-includes/ms-files.php?file=2010/07/10-24-02-005_deb1.jpg

    You don't see the redirect, but that's okay. Still, THAT is a 404 as well.

    The file itself should be uploaded in something like:
    http://www.bremondhouse.com/wp-conent/blogs.dir/1/files/2010/07/10-24-02-005_deb1.jpg

    Can you check that it's there?

  15. davewarnerrecorder
    Member
    Posted 3 years ago #

    You know - it WOULD give an error because I had read that the word file or files in the path was a problem and I moved them to an images directory. Doh! Anyway, that was the only place it was NOT working now that you have given me the correct HTACCESS, so THANK YOU! I have been chasing a solution for weeks...

  16. *salute* No prob :)

  17. DigiJan
    Member
    Posted 3 years ago #

    I have the same problem, but instead of subdomains I'm using subfolders. Did make a new thread where the setup and problem is explained:

    http://wordpress.org/support/topic/images-loaded-ok-to-server-but-images-arent-displayed

    Any ideas why images aren't showing up correctly in subblogs (they are shown as broken images eg. not found)? Any ideas ipstenu? Really need to get this working, so any ideas are welcome (besides don't use IIS6...) :)

    Br

    Jan

Topic Closed

This topic has been closed to new replies.

About this Topic