WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
i just cant get it to work (26 posts)

  1. runningplus
    Member
    Posted 3 years ago #

    Hi there,

    Maybe of you guys can gimme a little help.

    I installed WP-cache on my wordpress site.
    I just cant enable it.

    I searched for a solution on the internet, but i just cant figure it out.

    I did the things that writen down under, but nothing worked.
    And still this is the only thing that its telling me.

    Pls help, cause my site is getting..slowwwww

    Warning! /home/deb13087/domains/runningplus.nl/public_html/wordpress/wp-content/advanced-cache.php does not exist or cannot be updated.

    1. If it already exists please delete the file first.
    2. Make /home/deb13087/domains/runningplus.nl/public_html/wordpress/wp-content writable using the chmod command through your ftp or server software. (chmod 777 /home/deb13087/domains/runningplus.nl/public_html/wordpress/wp-content) and refresh this page. This is only a temporary measure and you’ll have to make it read only afterwards again. (Change 777 to 755 in the previous command)
    3. Refresh this page to update /home/deb13087/domains/runningplus.nl/public_html/wordpress/wp-content/advanced-cache.php
    If that doesn’t work, make sure the file /home/deb13087/domains/runningplus.nl/public_html/wordpress/wp-content/advanced-cache.php doesn’t exist:
    1. Open /home/deb13087/domains/runningplus.nl/public_html/wordpress/wp-content/plugins/wp-super-cache/advanced-cache.php$wp_cache_file in a text editor.
    2. Change the text CACHEHOME to /home/deb13087/domains/runningplus.nl/public_html/wordpress/wp-content/plugins/wp-super-cache/
    3. Save the file and copy it to /home/deb13087/domains/runningplus.nl/public_html/wordpress/wp-content/advanced-cache.php and refresh this page.

  2. runningplus
    Member
    Posted 3 years ago #

    I allready found it.

    You must also set de Cache folder in de content folder writable.

    one question.:
    It now says:

    Rewrite rules must be updated

    The rewrite rules required by this plugin have changed or are missing. Scroll down the Advanced Settings page and click the Update Mod_Rewrite Rules button.

    And when i click that button, my site will give an error, and no one can get on it anymore.

    Is this nessasary to set this Rules must be updated?

  3. bob_wp
    Member
    Posted 3 years ago #

    Hi

    If you are using "rewrite caching" then indeed you need to update the rules.

    Are you running rewrite caching?

    Bob

  4. runningplus
    Member
    Posted 3 years ago #

    No i,m not running rewrite caching, cause when i eneble this, the site crashes.

    But what does this "rewrite chaching" do?

  5. bob_wp
    Member
    Posted 3 years ago #

    Hi

    The only time I see the stuff about rewrite rules is when I check the top box on the advanced setup menu. That's the one that enables rewrite caching instead of php caching.

    The cache can either work by feeding back information at the php level (the code) or by re-writing the request (the server level). Doing it at the server level is slightly faster according to the docs. rewrites are also a bit more complex to set up.

    Did you have another cache set up before you installed Super Cache?

    Bob

  6. ninjazen
    Member
    Posted 3 years ago #

    runningplus, were you able to work this out?

    I also get

    Rewrite rules must be updated

    The rewrite rules required by this plugin have changed or are missing. Scroll down the Advanced Settings page and click the Update Mod_Rewrite Rules button.

    Notice: Mod_rewrite or Legacy caching enabled. Showing Advanced Settings Page by default.

    Scrolling down I see no button, but another note

    Mod Rewrite Rules

    Mod Rewrite rules cannot be updated!

    You must have BEGIN and END markers in /.htaccess for the auto update to work. They look like this and surround the main WordPress mod_rewrite rules:

    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress
    Refresh this page when you have updated your .htaccess file.

    My host says we can do mod-rewrite. I do have

    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    in my .htaccess already...

    I don't know what is going on...

    Bob,
    Should I click to "use PHP" instead of "use mod rewrite"?? (I don't really what that means...)

    Would anyone please give me an advice??

    Thank you.

  7. bob_wp
    Member
    Posted 3 years ago #

    Hi

    I found that I had to copy the "example" .htaccess stuff directly from the Super Cache admin page into the .htaccess in the wordpress root directory to get it to recognize that it was there. Maybe I had a typo, who knows.

    Once the correct stuff was in .htaccess It then brought up more stuff on the Super Cache page to allow it to try the .htaccess rule add. The file needed to be writable by the server in order for that to work.

    Again, I only saw this stuff after I checked "use mod_rewrite" instead of "use PHP". Getting the "use PHP" up and running was very simple.

    Bob

  8. ninjazen
    Member
    Posted 3 years ago #

    Hi Bob,
    Thank you for your info.
    I already had .htaccess in my file.
    But a support person suggested me to add another, totally new, different .htaccess in the file "wp-content/cache/".
    Now I have one .htaccess in the main file and have another one... the file "wp-content/cache/.htaccess".

    I already had copied

    # BEGIN supercache
    <IfModule mod_mime.c>
    <FilesMatch "\.html\.gz$">
    ForceType text/html
    FileETag None
    </FilesMatch>
    AddEncoding gzip .gz
    AddType text/html .gz
    </IfModule>
    <IfModule mod_deflate.c>
    SetEnvIfNoCase Request_URI \.gz$ no-gzip
    </IfModule>
    <IfModule mod_headers.c>
    Header set Cache-Control 'max-age=300, must-revalidate'
    </IfModule>
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html A300
    </IfModule>

    # END supercache

    in my newly created wp-content/cache/.htaccess

    Did I follow a wrong advice? Should I have copied this into the .htaccess I had already?

    I see this in my page source.

    <!-- Dynamic page generated in 3.292 seconds. -->
    <!-- Cached page generated by WP-Super-Cache on 2010-11-02 15:24:32 -->
    <!-- super cache -->

    Does that mean the plugin is working even though the wp super cache plugin page still says

    Mod Rewrite rules cannot be updated!

    Any help would be appreciated.
    Thank you.

  9. bob_wp
    Member
    Posted 3 years ago #

    Hi

    There are two .htaccess files involved here. One is in "/" and the other one is in "/wp-content/cache". The one that needs the # Begin stuff is the one in "/" . The "Rules cannot be updated" is complaining about the "/.htaccess" file and not about the "/wp-content/cache/.htaccess" file.

    Bob

  10. ninjazen
    Member
    Posted 3 years ago #

    Hi Bob,
    Does that mean I should delete the file "wp-content/cache/.htaccess" and add

    # BEGIN supercache
    <IfModule mod_mime.c>
    <FilesMatch "\.html\.gz$">
    ForceType text/html
    FileETag None
    </FilesMatch>
    AddEncoding gzip .gz
    AddType text/html .gz
    </IfModule>
    <IfModule mod_deflate.c>
    SetEnvIfNoCase Request_URI \.gz$ no-gzip
    </IfModule>
    <IfModule mod_headers.c>
    Header set Cache-Control 'max-age=300, must-revalidate'
    </IfModule>
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html A300
    </IfModule>

    # END supercache

    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    in the "/.htaccess"?
    Is the order right?

    Do I need to add the lines

    RewriteEngine On
    RewriteBase /

    somewhere?

    Thank you.

  11. runningplus
    Member
    Posted 3 years ago #

    If i put that code in mt htacces file, my site is failing...

  12. ninjazen
    Member
    Posted 3 years ago #

    Oh, no, runningplus. That's not good...
    Did you ever find the solution? I hope someone would help us!!

  13. bob_wp
    Member
    Posted 3 years ago #

    Hi

    No, the "BEGIN WordPress" stuff does not go in /wp-content/cache/.htaccess.

    The stuff you have shown between # BEGIN supercache and # END supercache is correct for /wp-content/cache/.htaccess.

    Completely different rules go into /.htaccess once it is set up with the # BEGIN WordPress and # END WordPress tags. The only thing you need to do manualy is add those tags to /.htaccess if they are not there already. Everything else you need is done for you by the magic of the Super Cache admin page.

    If you are having all this trouble why are you using rewrite caching? Just click the box for php caching and all these issues will go away.

    Bob

  14. bob_wp
    Member
    Posted 3 years ago #

    Hi

    One other point, you do not want the goop between the tags in the /.htaccess file. What you add looks like this:

    # BEGIN WordPress
    # END WordPress

    and not like this:

    # BEGIN WordPress
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    That all *assumes* you have a blank /.htaccess file with nothing in it. If there's stuff in there already you would do this:

    # BEGIN WordPress
    everything that's in there now goes here
    # END WordPress

    That assumes that WordPress put the stuff in the /.htaccess file. If not you will have to figure out where the file came from.

    Bob

  15. ninjazen
    Member
    Posted 3 years ago #

    Thank you, Bob.
    I am learning a lot.

  16. bob_wp
    Member
    Posted 3 years ago #

    Hi

    Mod_rewite is a fine thing. It's recomended mainly because it adds a slight bit more performance. The setup is much more involved. I suspect it's more likely to have strange interactions with other stuff. I have benchmarked both mod_rewrite and php on my site and found little differance in static tests. Static testing is *never* perfect, so in the real world there may be a greater differance.

    Bob

  17. runningplus
    Member
    Posted 3 years ago #

    I learned also alot Bob,
    Thanx for you,re time!!

  18. bob_wp
    Member
    Posted 3 years ago #

    Hi

    This stuff could be a lot easier than it is. Of course you are doing some *very* complex things with these plugins. Not simple at all...

    Bob

  19. ninjazen
    Member
    Posted 3 years ago #

    Hi,
    As Bob said, I unchecked the Mod_Rewrite and checked PHP. And there was no more "warning" sign.

    Now I am a bit curious (or ambitious), my webhost support person thinks I can do mod-rewrite, but my .htaccess is not writable. They want me to copy what the installation instruction says (below) and paste it instead. They asked me to ask the plugin author where exactly I am supposed to paste this in my .htaccess before I do anything.

    -----------------.htaccess-----------------
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz [L]

    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    -----------------.htaccess-----------------

    I read Bob's comment, and it sounded like Bob pasted his as well (?)

    So, are these lines supposed to go before or after or in the middle of the following in my .htaccess??

    #BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    #END WordPress

    Could Donncha or automattic verify this? so I can go back to my web host support person and let them know this worked?

    Thank you.

  20. bob_wp
    Member
    Posted 3 years ago #

    Hi

    You do *not* want to post what comes after

    #BEGIN WordPress

    and before

    #BEGIN WordPress

    The only reason to paste any of the "WordPress" tags is to enable the automatic stuff to work.

    The stuff you *do* want to paste is between the Super Cache begin and end tags.

    Again, if there's something else already in the /.htaccess file, be carefull you don't mess it up. (as in don't erase it).

    If you have the WordPress tags in your /.htaccess then put the Super Cache stuff *before* the WordPress stuff. The same would be true if your /.htaccess had WordPress generated lines that did not have the tags on them. The SuperCache stuff would go before that as well.

    Bob

  21. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Don't bother using mod_rewrite mode if you're having problems with it. PHP mode will be almost as fast and you honestly won't notice a difference. It's much easier to get working too!

  22. ninjazen
    Member
    Posted 3 years ago #

    Thank you, Bob.
    Thank you, Doncha.

    Doncha,
    I didn't see either of your messages, and I actually left mod_write clicked all day and all night.
    My .htaccess was the same (nothing added), and the wp super cache plugin setting page still says mod_rewrite is not being updated, but the page source keeps logs... like the one example below;

    <!-- Dynamic page generated in 0.208 seconds. -->
    <!-- Cached page generated by WP-Super-Cache on 2010-11-04 09:12:39 -->

    So, I contacted my webhost support, and the tech person says he can see that it is saving cached files. He thinks it's caching (except amazon and other ads... is the wp super cache supposed to cache ads?) for the server's end.
    So now, I am confused.
    Should I keep this setting or should I go back and unclick mod_rewrite and goes back to PHP setting?

    Thank you.

  23. bob_wp
    Member
    Posted 3 years ago #

    Hi

    If Super Cache finds the rewrite rules in your /.htaccess file, it will use mod_rewrite caching. The "php caching" setting will be overridden.

    Don't ask how I know this ... it's in the same file as, "gee if wp-cron stops working right all sorts of things break in odd ways (including Super Cache) ...".

    Bob

  24. ninjazen
    Member
    Posted 3 years ago #

    Hi Bob,
    I am not sure I get it.
    Even though my .htaccess don't look anything like the one in the instruction, should I leave it like that and keep mod_write?
    Or.. since this is strange, I should go back to PHP?

  25. bob_wp
    Member
    Posted 3 years ago #

    Hi

    Super Cache looks for the tags:

    # BEGIN SuperCache
    # END SuperCache

    (that may not be the right capitalization and it does matter)
    if it finds them it decides to use mod_rewrite. If it does not find them it decides the rules aren't loaded acts accordingly.

    If you simply comment out the rules (and don't delete the tags) super cache gets *very* confused.

    If you are going to use mod_rewrite, the super cache rules need to be pretty much exactly as shown in the plugin. If they are not, Super Cache will likely mess up in one way or the other.

    The rest of the rules in the /.htaccess file also need to be right. That's not just for Super Cache, that's true for WordPress in general. If the rules are not right, odd things will break here and there.

    Bob

  26. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    ninjazen - yes, go back to PHP caching. You won't notice a difference and it's easier to get working. That's why it's on the "simple setup" page :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic