WP Super Cache – WPSC htaccess Code Not Found

Home Forums BulletProof Security Pro WP Super Cache – WPSC htaccess Code Not Found

This topic contains 13 replies, has 4 voices, and was last updated by  AITpro Admin 1 year, 4 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1974

    AITpro Admin
    Keymaster

    Email Question (New question Split from non-related Topic):

    Also – setting the httacces file to writeable and then updating WP Super Cache and then closing it off again doesn’t remove the WPSC warning in that same screenshot.

    bps-wp-super-cache-error

    #1985

    AITpro Admin
    Keymaster

    Are you using mod_rewrite in WP Super Cache?  If not, then just edit your root .htaccess file and add this – #WPSuperCache – directly above the # BEGIN WordPress line of code in your Root .htaccess file as shown in the example below.

    Example:

    #WPSuperCache
    # BEGIN WordPress

    #7560

    Drew Conroy
    Participant

    Hi:

    I just installed BPS Pro and I get the following at the top of the page:

    WP Super Cache is activated, but either you are not using WPSC mod_rewrite to serve cache files or the WPSC htaccess code was NOT found in your root htaccess file. If you are not using WPSC mod_rewrite then just add this commented out line of code in anywhere in your root htaccess file – # WPSuperCache. If you are using WPSC mod_rewrite and the WPSC htaccess code is not in your root htaccess file – unlock your Root htaccess file temporarily then click this Update WPSC link to go to the WPSC Settings page and click the Update Mod_Rewrite Rules button. If you have put your site in Maintenance Mode then disregard this Alert and DO NOT update your Mod_Rewrite Rules. Refresh your browser to perform a new HUD htaccess file check.
    Before you click the WPSC Update Mod_Rewrite Rules button turn Off AutoRestore and then after updating WPSC click the Backup Files Now button and then turn AutoRestore On again.

    WHEN I CLICK THIS LINK “Update WPSC link” TO FIX IT I GET THE FOLLOWING:
    Warning! Could not update /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-config.php! WPCACHEHOME must be set in config file.

    Warning! /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/advanced-cache.php does not exist or cannot be updated.

    1. If it already exists please delete the file first.
    2. Make /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content writable using the chmod command through your ftp or server software. (chmod 777 /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/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 /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/advanced-cache.php
    If that doesn’t work, make sure the file /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/advanced-cache.php doesn’t exist:1.1. Open /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/plugins/wp-super-cache/advanced-cache.php$wp_cache_file in a text editor.
    2.2. Change the text CACHEHOME to /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/plugins/wp-super-cache/
    3.3. Save the file and copy it to /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/advanced-cache.php and refresh this page.

    I have tried to fix this but no luck. I am finding it very confusing actually. Can anyone please help or suggest anywhere to start?

    Thank you- Drewstar13

    #7566

    AITpro Admin
    Keymaster

    UPDATE: BPS Pro 13+ and BPS 2.0+ versions have a feature called: Setup Wizard AutoFix (AutoWhitelist|AutoSetup|AutoCleanup) that automatically creates plugin and theme whitelist rules and automatically sets up and cleans up caching plugins htaccess code.

    With the new Custom Code text boxes added in BPS Pro you can now copy and paste this:  #WPSuperCache into this Custom Code text box.


    #WPSuperCache

    If you decide to use the WP Super Cache mod_rewrite at a later time instead of using WP Super Cache php caching then see this WP Super Cache forum topic link below on setting up WP Super Cache mod_rewrite.

    http://forum.ait-pro.com/forums/topic/where-is-the-log/#post-2715

    #7571

    Drew Conroy
    Participant

    I do not see the code for the following????
    5. Copy the WP Super Cache .htaccess mod_rewrite code. that I am supposed to copy????

    #7573

    AITpro Admin
    Keymaster

    You will see the WP Super Cache .htaccess code displayed on the WP Super Cache Advanced tab page after you select this Radio button:  Use mod_rewrite to serve cache files. (Recommended) and click the Update Status button.  Then Scroll down to this section of the page:

    Mod Rewrite Rules

    The .htaccess code will look like this (do NOT use this code – this is an example ONLY):

    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /bpspro/
    #If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/bpspro/wp-content/cache/supercache/%{SERVER_NAME}/bpspro/$1/index-https.html.gz -f
    RewriteRule ^(.*) "/bpspro/wp-content/cache/supercache/%{SERVER_NAME}/bpspro/$1/index-https.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/bpspro/wp-content/cache/supercache/%{SERVER_NAME}/bpspro/$1/index.html.gz -f
    RewriteRule ^(.*) "/bpspro/wp-content/cache/supercache/%{SERVER_NAME}/bpspro/$1/index.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTPS} on
    RewriteCond %{DOCUMENT_ROOT}/bpspro/wp-content/cache/supercache/%{SERVER_NAME}/bpspro/$1/index-https.html -f
    RewriteRule ^(.*) "/bpspro/wp-content/cache/supercache/%{SERVER_NAME}/bpspro/$1/index-https.html" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTPS} !on
    RewriteCond %{DOCUMENT_ROOT}/bpspro/wp-content/cache/supercache/%{SERVER_NAME}/bpspro/$1/index.html -f
    RewriteRule ^(.*) "/bpspro/wp-content/cache/supercache/%{SERVER_NAME}/bpspro/$1/index.html" [L]
    </IfModule>
    # END WPSuperCache
    #7577

    Drew Conroy
    Participant

    I went through the process and did everything and the above as well.  When I click on WP Super Cache I still get the following:
    Warning! Could not update /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-config.php! WPCACHEHOME must be set in config file.

    Warning! /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/advanced-cache.php does not exist or cannot be updated.

    1. If it already exists please delete the file first.

    2. Make /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content writable using the chmod command through your ftp or server software. (chmod 777 /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/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 /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/advanced-cache.php

    If that doesn’t work, make sure the file /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/advanced-cache.php doesn’t exist:

    1. Open /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/plugins/wp-super-cache/advanced-cache.php$wp_cache_file in a text editor.
    2. Change the text CACHEHOME to /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/plugins/wp-super-cache/
    3. Save the file and copy it to /data/20/2/71/15/2886341/user/3181815/htdocs/sweeps13/sweeps13/wp-content/advanced-cache.php and refresh this page.

    Cannot continue… fix previous problems and retry.

    #7578

    AITpro Admin
    Keymaster

    Create a temporary WordPress Admin login account and send it directly too:  edward [at] ait-pro [dot] com and I will log in and setup WP Super Cache for you on your website.  Thanks.

    #28603

    growitsolutions
    Participant

    [Topic has been merged into this relevant Topic]
    Hi, I have been trying to install some caching plugins, namely WP Super Cache and W3 Total Cache. I am getting a lot of issues / messages from bps. Is there a install guide for either?

    Regards

    #28607

    AITpro Admin
    Keymaster

    @ growitsolutions – See this forum topic for WP Super Cache setup steps:  http://forum.ait-pro.com/forums/topic/where-is-the-log/#post-2715  See this forum topic for W3 Total Cache setup steps:  http://forum.ait-pro.com/forums/topic/installing-w3-total-cache-with-bulletproof-security-pro/

    #32222

    Steve
    Participant

    [Topic has been merged into this relevant Topic]
    I started this topic under the non-pro version so thoughts I’d paste the comments here to continue.  Please see the future posts.

    I recently upgraded to BulletProof Security pro and have had issues with it ever since. I had a lot of teething trouble with it and kept getting the following error “WP Super Cache is activated, but either you are not using WPSC mod_rewrite to serve cache files or the WPSC htaccess code was NOT found in your root htaccess file.”
    I had already correctly setup the basic BPS (with WP Super Cache installed, but when I installed the Pro version it kept saying that there were errors. Even after I had fixed the issues on multiple occassions. I eventually managed to fix it for longer than a day without the error messages showing but as soon as I updated a WP plugin, it all started again.
    I really don’t want to have to go through this everytime I need to run basic updates, so would appreciate some help getting this up and running once and for all.
    Or should I simply delete it and revert back to the basic version or try something else completely?
    I’ll be happy to provide any further info you need. Any help or advice would be appreciated.
    Thanks,
    Steve
    P.S. I have tried many different things, I followed in the BPS forums. About 15 different variations or methods of fixing the issues but with no (permanent) luck.

    This was your response:
    It sounds like something else you have installed (plugin or theme) is using the WordPress flush_rewrite_rules() function and wiping out/flushing your BPS Root htaccess file/code repeatedly, which is a fairly common problem due to the WordPress flush_rewrite_rules() function being used inappropriately. To permanently resolve this problem > Go to the BPS Pro > B-Core page > htaccess File Editor tab page > click the Lock htaccess File button and the Turn On AutoLock button. Locking your Root htaccess should prevent the problem from continuing to happen.

    Per the WP forum rules only free plugins should be supported in the WP forums and not paid/premium versions of plugins. So in the future please post any BPS Pro questions in the BPS Pro forum here: https://forum.ait-pro.com/forums/forum/bulletproof-security-pro/

    I am trying to get rid of the error message about WP Super Cache again.  I have turned off F-lock, auto-restore, root folder bullet proof mode, unlocked htaccess file ad turned off auto lock.  Every time I try to update Mod_Rewrite Rules as per the instructions it displays the following error:

    “Mod Rewrite rules cannot be updated!”

    I have tried pasting the updated rules into the htaccess file as well but as soon as I activate or reinstate any of the above options in BPS pro, the error messages start appearing again.  The Mod rewrite rules are always removed from the secure htaccess file.

    After attempting this too many times to count, I am getting really frustrated.  Is it possible for me to provide login info for my site so you can have a look and see what is going wrong with it??

    Any help or advice on how to get this working properly would be appreciated.

    Thanks,
    Steve

    P.S. As per your previous comments about settings within the htaccess area…  all of these were already set up correctly…

    #32230

    AITpro Admin
    Keymaster

    @ Steve – Yep, send me a WordPress Administrator login to this site so I can figure and fix the problem permanently.  I noticed something odd about WP Super Cache that last time I looked at it on someone else’s site.  It seemed like WP Super Cache was automatically reverting/changing its own settings based on what it thought was a problem.  Of course that just made things much worse. 😉  Send the WP Admin login info to:  info at ait-pro dot com

    #32233

    Steve
    Participant

    Thanks for getting back to me so quickly.  I’ve just emailed you my login details.

    Let me know if you need anything else from me.

    #32234

    AITpro Admin
    Keymaster

    @ Steve – The WP Super Cache problem has been fixed permanently.  See other fixed problems, issues and descriptions below.

    Problem:
    Fixed: The WP Super Cache htaccess code was copied to the BPS Custom Code text box, but the BEGIN and END placeholder tags for WP Super Cache were not included in that WP Super Cache htaccess code. Placeholder tags are very important because all plugins or themes will add a BEGIN and END placeholder tag so that they can find their htaccess code, including the BPS plugin and WordPress itself.
    # BEGIN WPSuperCache
    # END WPSuperCache
    _____________________

    Additional problems:
    Fixed: You have added the standard/default WP Rewrite code in BPS Custom Code. BPS already uses/incorporates/includes the standard/default WP Rewrite code in BPS htaccess code. I have deleted the standard/default WP Rewrite code from BPS Custom Code.

    Fixed: Your www to non-www Rewrite code needed to be included in the standard BPS WP Rewrite Loop start code in Custom Code, which I have done.

    Fixed: You had redundant Browser Caching code, but it is not hurting anything. So I have moved it below the WP Super Cache htaccess code in Custom Code.

    wp-config.php file:
    Fixed: Blank spaces at the top of the wp-config.php file
    Fixed: duplicate define( 'WP_CACHE', true ); constant used.

    System Info page:
    Unresolved: Something is blocking the wp_remote_get() function on your website. I was unable to find the cause of this problem. BPS Pro self-protection htaccess files are not being created in BPS plugin folders due to whatever is causing this problem. That is not a critical problem. So you may want to just ignore whatever is causing that problem. All other BPS Pro htaccess files are being created and working correctly.

    Apache Modules|Directives|Backward Compatibility(Yes|No)|IfModule(Yes|No): View Visual Test
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ERROR: wp_remote_get() function is blocked or unable to get the URL path
    ___________________________

    Other:
    WP Super Cache will display this error message below on the WP Super Cache settings page. You can disregard that WP Super Cache error message because BPS does not use the WP BEGIN and END markers/placeholders for a very important reason – basically using the WP markers causes massive amounts of other serious/critical problems.

    Mod Rewrite rules cannot be updated!

    You must have BEGIN and END markers in /home/sites/eyetooth-art.co.uk/public_html/.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.

    ________________________

    Recommended Change: php output buffering should be turned Off for WordPress. Currently output buffering is turned on.
    To turn off output buffering edit/change your custom php.ini file settings.
    PHP Output Buffering: 4096
    Performance WP Specific: Allow or Disallow output buffering. Output buffering is a mechanism for controlling how much output data (excluding headers and cookies) PHP should keep internally before pushing that data to the client. Output buffering does not work well on WordPress sites and causes slower performance. For other types of sites that are NOT WordPress the recommended output buffering setting is: output_buffering = 4096. The ouput buffering setting for WordPress should be: output_buffering = 0 or output_buffering = Off.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.