• 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 https://www.weeklyexpressnews.com sample subdomain site is https://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?

Viewing 15 replies - 1 through 15 (of 16 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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
    Thread Starter davewarnerrecorder

    (@davewarnerrecorder)

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

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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?

    Thread Starter davewarnerrecorder

    (@davewarnerrecorder)

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

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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
    Thread Starter davewarnerrecorder

    (@davewarnerrecorder)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

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

    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

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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 ??

    Thread Starter davewarnerrecorder

    (@davewarnerrecorder)

    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 https://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).

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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.

    Thread Starter davewarnerrecorder

    (@davewarnerrecorder)

    I don’t know. Anyway, like you say – fixed is good! Look at https://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?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    .htaccess JUST in root.

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

    Anyway.

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

    Okay!

    The broken link should be redirected to this:
    https://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:
    https://www.bremondhouse.com/wp-conent/blogs.dir/1/files/2010/07/10-24-02-005_deb1.jpg

    Can you check that it’s there?

    Thread Starter davewarnerrecorder

    (@davewarnerrecorder)

    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…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    *salute* No prob ??

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Images don't show’ is closed to new replies.