Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • That is what I want.. I just changed the redirect rule once more (added [P] for proxy redirect for SEO):

    RewriteCond %{HTTP_HOST} ^secondarydomain1\.com
    RewriteRule ^files/(.*)$ https://secondarydomain1.com/wp-content/blogs.dir/10/files/$1 [P, L]

    Thank you very much!! You have been very helpfull!!

    For whom it might interest, I ended up with:

    RewriteCond %{HTTP_HOST} ^secondarydomain1\.com
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.*)$ https://secondarydomain1.com/wp-content/blogs.dir/10/files/$2 [L]

    Of course placed above:

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

    And actually as I look at it, I’m thinking about trying to change it to a simplyfied version:

    RewriteCond %{HTTP_HOST} ^secondarydomain1\.com
    RewriteRule ^files/(.*)$ https://secondarydomain1.com/wp-content/blogs.dir/10/files/$1 [L]

    That’s a fix that might work.. but what if I want my images to be located on it’s own domain (for SEO).

    You don’t think a htaccess url rewrite rule would make this memory issue disappear? (moving the redirect away from php and into htaccess)

    htaccess psedo like:
    if secondarydomain1.com/wp-content redirect to secondarydomain1.com/wp-content/1/
    if secondarydomain2.com/wp-content redirect to secondarydomain1.com/wp-content/2/
    etc… ?

    Could you help me with at rewrite rule to achieve this, please ? ??

    You sure do sounds like you know all about this ??

    So lets say the issue is the extra redirect through ms-files.php – couldn’t I just use a more simple/hardcoded htaccess redirect instead? Would it help?

    I understand it has to do more – BUT, what I don’t get is:

    • Why is my images affected so much? It should be a straight forward redirect? How much memory can this use extra?
    • Why is my primary site NOT affected at all? It’s the same code running..
    • What is different between primary and secondary sites?

    I’m on a shared server – 128 MB memory limit
    I can upgrade to 256 MB memory limit – but I really doubt it would help?

    I read a theory on another site, stating this issue might be caused because the code or server is constantly setting the memory_limit to 128 MB before each call.. The theory is, every time you set this value, it will try to allocate the full amount of memory (128 MB) for a very short period of time (like 100 ms) and then afterwards go down to actual usage (could be everything from 0-128 MB). So having 8 requests hit the server at the same time, will result in 8 assignments almost at the same time – and some of them will fail.

    Please note this is a theory taken out of context from another thread talking about the same issue – but maybe this rings some bells for you that isn’t ringing for my ears ?? ?

    I have the exact same problem !!! And got the memory error as well..

    Why is the memory usage different with WP MU/MS for secondary sites?

    I have absolutely no problem serving site on my primary site

    I’ve tried to get answer from StackOverflow – but with no answers yet ??

    https://stackoverflow.com/questions/10586029/wordpress-mu-wpmu-sometimes-images-isnt-showing

    I’ve tried to hire different WP developers to solve this issue – but no-one knows where to begin and end..

    What is the difference between serving the primary site and all the secondary sites?

    Did you find any solution?

    Thread Starter NickNiebling

    (@nickniebling)

    Well no.. It’s a custom theme..

    My Advice is to try following:

    1. Disable all plugins but Hyper Cache (if it works, enable one at a time to find the blocker)
    2. Change to standard theme – if it works, go back to your theme and try:
    1. Disable all in your functions.php
    2. Disable all not standard WP in header.php
    3. Disable all not standard WP in index.php
    4. Disable all not standard WP in footer.php
    Thread Starter NickNiebling

    (@nickniebling)

    Before (trying) to use a caching plugin, the theme had tried to do some speed optimization itself by using zlip to gzip the output for minimized bandwidth transfer..

    Well.. It’s clear to me – DON’T ??

    Here is the code I’ve removed from my functions.php:

    if(extension_loaded("zlib") && (ini_get("output_handler") != "ob_gzhandler")) {
    	add_action('wp', create_function('', '@ob_end_clean();@ini_set("zlib.output_compression", 1);'));
    }

    Author: https://stffn.dk/2011/04/useful-wordpress-functions/

    (The script works just fine – just not together with caching)

    Thread Starter NickNiebling

    (@nickniebling)

    Disabling all plugins makes no difference.
    Using default theme “solves” the issue.. So it must be theme related..

    It would be nice to know how the plugin rely on theme structure.. I’m still doing a lot of debugging trying to find out whats wrong..

    Thread Starter NickNiebling

    (@nickniebling)

    IE Private browsing and Chrome inkognito both cleanup all cookies etc. and make a “fresh browse” – but still no cache..

    I’ll try disable my plugins and change theme to see what happens with the caching.

    I’ll post any update on this matter here later today..

    Thread Starter NickNiebling

    (@nickniebling)

    Thank’s for the feedback. I found this in plugins/hyper-cache/cache.php:

    if (!file_exists($hc_file)) {
        hyper_cache_start(false);
        return;
    }

    But it didn’t help to remove the return. Could you please verify you got the same code in your file and you edited it to:

    if (!file_exists($hc_file)) {
        hyper_cache_start(false);
    }

    I’ve been looking for a solution for a long time now ?? And it’s so frustrating..

Viewing 12 replies - 1 through 12 (of 12 total)