Support » Networking WordPress » No images at all on multisite subdirectories frontend/backend

  • Resolved flwsll

    (@flwsll)



    I have a new wp multisite 3.01 install using subdirectories, everything works fine except that something seems to go wrong with the image rewrites. while all images display on the main blog and i can upload images in the posts there, no images display in the subdirectory blogs at all. the admin backend of the subdirectory blogs doesn’t show any of its small images. i can upload images to the media gallery but they don’t display. the image files do get written under /wp-content/blogs.dir/(blogid)/files/2010/11/name.jpg but they don’t display with the rewritten url wp tries to access them, neither in the backend nor the frontend.

    i have pasted this htaccess as instructed:

    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]

    i have no clue what goes wrong and appreciate any advice. i am using the following plugins:

    blog topics (with original rewrites.php)
    blog defaults
    diamond multisite widgets
    platinum seo pack

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

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Is that your entire .htaccess? There’s no other code in there?

    I would turn off “blog topics (with original rewrites.php)” personally. I’m not sure what it does, but the fact that you said ‘with original rewrites.php’ makes me wonder if it’s sneaking some htaccess changes in there.

    yes there is no the code in the .htaccess.

    i really need the blog topics plugin for the project i am planning, it only rewrites its additional /topics/ and /sites/ directory url’s, this is the entire code of rewrites.php which is included in functions.php

    <?php

    add_filter(‘generate_rewrite_rules’, ‘cets_fyi_theme_rewrites’);

    function cets_fyi_theme_rewrites( $wp_rewrite )
    {
    $new_rules = array(
    ‘topic/(.+)’ => ‘index.php?topic=’ . $wp_rewrite->preg_index(1),
    ‘sites/(.+)’ => ‘index.php?sitelist=’ . $wp_rewrite->preg_index(1)
    );

    $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
    }

    add_action(‘init’, ‘cets_fyi_theme_flush_rewrite_rules’);

    function cets_fyi_theme_flush_rewrite_rules()
    {
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
    }

    // add topic as an allowed query var
    function cets_fyi_theme_add_topicvar($public_query_vars) {
    $public_query_vars[] = ‘topic’;
    return $public_query_vars;
    }
    add_filter(‘query_vars’, ‘cets_fyi_theme_add_topicvar’);

    // add sites as an allowed query var
    function cets_fyi_theme_add_sitesvar($public_query_vars) {
    $public_query_vars[] = ‘sitelist’;
    return $public_query_vars;
    }
    add_filter(‘query_vars’, ‘cets_fyi_theme_add_sitesvar’);

    add_action(‘template_redirect’,’cets_fyi_theme_template’);

    /*
    This function stops processing the index.php and includes a template specific for the query arg
    */

    function cets_fyi_theme_template($arg){
    global $wp_query;
    // if neither topic nor sites is set, just get out of here
    if( !isset($wp_query->query_vars[‘topic’]) && !isset($wp_query->query_vars[‘sitelist’]) )
    return $arg;

    if (isset($wp_query->query_vars[‘topic’])) {
    // if the topic var is set, set the topic var as the template
    $template = TEMPLATEPATH . “/topic.php”;
    }
    else {
    $template = TEMPLATEPATH . “/sites.php”; // otherwise, this must be a sites template
    }

    // make sure the file actually exists
    if (file_exists($template)) {
    require_once($template);
    die(); //To stop anything further being run
    }
    else {return $arg;} // the file didn’t exist – get outa here.
    }

    ?>

    the plugin is described here http://deannaschneider.wordpress.com/2010/02/22/blog-topics-plugin-take-two/

    i meant “no other code in htaccess” ofc

    It;s not the blog topics plugin. (I use it myself)

    Give us a link to the images & the sites, becasue then it will make this thread a whole lot shorter.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Standard troubleshooting process:

    1) Turn off ALL your plugins
    2) Switch to the default theme

    IF the problem goes away, turn back on your theme. Then each plugin, one at a time.

    Yes, we understand you need the plugin, but we have to sort out WHAT is wrong 🙂 Sometimes it’s two plugins in combination, sometimes it’s one, sometimes it’s a theme. But you have to start playing around or you get nowhere.

    ok ipstenu i will do that and report back. sry i can’t publish the blog url here

    ok i have removed all plugins from mu-plugins, deactivated all plugins on the main blog and on several subdirectory blogs. i have set the twentyten theme on all these blogs, too. the error still persists, no images on the subdirectories at all. so i still think it’s an htaccess or some server config issue?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Check if mod_rewrite is turned on for your server/account.

    yes mod_rewrite is on and works fine on the main blog

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    So pretty permalinks are working? (I’m just double checking). Try putting AllowOverride All at the top of your .htaccess for grins and giggles.

    If that doesn’t work, let’s verify a couple things.

    1) Go to http://domain.com/subsite/wp-content/blogs.dir/(blogid)/files/2010/11/name.jpg and make sure the image shows.

    2) Go to http://domain.com/subsite/files/2010/11/name.jpg and see if the image shows THERE.

    3) What about http://domain.com/files/2010/11/name.jpg ?

    You also may want to skim this old post: http://wordpress.org/support/topic/mu-images-not-appearing?replies=19

    We had this one person who had a similar issue a while back that we could never resolve 🙁 Which sucked, but we DID come up with a workaround.

    FYI, I don’t do email support. No, seriously. The comment on my profile AND my website are not a joke. I’m not a consultant for hire. Just a dot-communist/socialist who likes to help in my free time from working for The Man at a fatcat bank 🙂 If you need to hire someone, check jobs.wordpress.net or google around. There are a lot of good, cool people for hire. The donation button on my site is mostly for my own amusement. I can count on one hand the number of people who’ve donated for reasons other than my plugins 🙂

    Also please read the many (many) threads here in the forum on this exact same issue….

    ipstenu sorry for not checking your profile/site better, i really appreciate your help here!

    1) image shows

    2) and 3) image doesn’t show

    will do some reading in the other threads…

    short answer: the htaccess file is not being read properly.

    hmm andrea, how can i fix that? is that a server config issue?

    Yep.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘No images at all on multisite subdirectories frontend/backend’ is closed to new replies.