Endurance Page Cache – infinite redirect loop, CSS and JS broken

Home Forums BulletProof Security Pro Endurance Page Cache – infinite redirect loop, CSS and JS broken

This topic contains 9 replies, has 3 voices, and was last updated by  AITpro Admin 1 year ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #32553

    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.

    The Endurance Page Cache must-use plugin was created by Mike Hansen at BlueHost sometime around November – December 2016.  The Endurance Page Cache must-use plugin is a static page caching plugin that is designed to improve website performance by caching dynamic php Source Code (WP website pages) as static HTML files.  The Endurance Page Cache must-use plugin is installed automatically by BlueHost and I assume all other web hosts that are owned by the Parent company Endurance International Group (EIG), which is currently around 80 different web hosts:  https://en.wikipedia.org/wiki/Endurance_International_Group

    General Info|issues|problems|setup steps with BPS and BPS Pro
    Note:  Endurance Page Cache Plugin Version 0.4 was used for testing. Older versions of the EPC plugin may contain slightly different htaccess code.

    The Endurance Page Cache must-use plugin is installed in the WordPress /wp-content/must-use/ folder.  The Endurance Page Cache must-use plugin creates this directory automatically:  /wp-content/endurance-page-cache/ where the static HTML files are created/stored.  The individual static HTML pages are created using this naming convention:  /[the subfolder name is the URI of a page or post]/_index.html.  If permalinks are being used on a website then this htaccess code below is automatically created in the website’s Root htaccess file.  This htaccess code is appended to the bottom of the Root htaccess file.

    # BEGIN WordPress
    Options -Indexes
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^/wp-content/endurance-page-cache/ - [L]
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP_COOKIE} !(wordpress_test_cookie|comment_author|wp\-postpass|wordpress_logged_in|wptouch_switch_toggle|wp_woocommerce_session_) [NC]
    RewriteCond %{DOCUMENT_ROOT}/wp-content/endurance-page-cache/$1/_index.html -f
    RewriteRule ^(.*)$ /wp-content/endurance-page-cache/$1/_index.html [L]
    </IfModule>
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    BPS and BPS Pro setup steps:
    Note:  The example code below may not be exactly the same as your actual EPC plugin htaccess code. So you want to copy your actual EPC plugin htaccess code from your Root htaccess file, copy it to BPS Custom Code and then modify it as shown below.

    1. Turn Off AutoRestore (BPS Pro Only).
    2. Go to Quarantine and restore all the EPC plugin’s _index.html files from Quarantine (BPS Pro Only).
    3. Go to the BPS htaccess File Editor tab page > Your Current Root htaccess File tab > scroll down to the bottom of your Root htaccess file and copy ONLY this portion of the EPC plugin htaccess code shown below into this BPS Custom Code text box: 1. CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
    Important Note:  If you do not see the EPC plugin’s htaccess code in your root htaccess file then use the code shown below and go to Step #5.
    4. Modify/edit the EPC plugin htaccess code that you copied to Custom Code and add the # BEGIN WordPress and # END WordPress placeholder/markers/identifier text as shown below. DO NOT use any other Markers or the EPC plugin will just continue to create new htaccess code in your Root htaccess file. The EPC plugin only recognizes the default WordPress Markers.
    5. Click the Save Root Custom Code button.
    6. Go to the BPS Setup Wizard page and run the Setup Wizard again (For BPS Pro run both the Pre-Installation Wizard first and then the Setup Wizard next).

    Additional Note for BPS Pro ONLY:  Running the Setup Wizards will automatically create an AutoRestore folder exclude rule for the /wp-content/endurance-page-cache/ folder so that this folder will no longer be checked by ARQ.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^/wp-content/endurance-page-cache/ - [L]
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP_COOKIE} !(wordpress_test_cookie|comment_author|wp\-postpass|wordpress_logged_in|wptouch_switch_toggle|wp_woocommerce_session_) [NC]
    RewriteCond %{DOCUMENT_ROOT}/wp-content/endurance-page-cache/$1/_index.html -f
    RewriteRule ^(.*)$ /wp-content/endurance-page-cache/$1/_index.html [L]
    </IfModule>
    # END WordPress

    EPC Plugin Additional Notes: The Endurance Page Cache must-use plugin has 2 option links on the Plugins page > Must-Use link page.  Disable and Purge Cache (if you click Disable you will then see an Enable option link).  If you click the Disable option link the /wp-content/endurance-page-cache/ folder is deleted, but the EPC plugin htaccess code is not removed from your Root htaccess file.  The top portion of the EPC htaccess code would not cause a problem, but the generic/default WP Rewrite code that is created by the EPC plugin will continue to cause infinite redirect loop errors as long as that code exists in your Root htaccess file.  A Dismiss Notice will be created in BPS .54.6 and BPS Pro 12.8 to alert someone that the EPC plugin is in use and will also contain a link to this forum topic and will also include a reminder in the Dismiss Notice help text that the EPC plugin’s htaccess code still exists in the Root htaccess file and will need to be manually removed even if the Disable option link has been clicked.

    #32557

    Hannah
    Participant

    Thank you so much for this information, and the updated htaccess code that lets us use it without screwing up our BPS htaccess files!

    I have a side note to your excellent writeup for other users who might need it. The EIG Endurance Page Cache “plugin” doesn’t always have an actual plugin page. In fact, I have never seen one, though I have seen the folder in the Plugins directory and of course the code in htaccess files for several sites. I can’t say why this is the case, but regardless of the existence of an actual plugin, the Endurance Page Cache code does appear in htaccess automatically when (or shortly after) WordPress is installed.

    #32558

    AITpro Admin
    Keymaster

    Yep, the Endurance Page Cache plugin can be installed like a regular plugin or a must-use plugin.  The EPC plugin does not have any menus and only has Action Links:  Activate, Deactivate, Edit, Delete, Disable, Enable, Purge Cache.  We tested both plugin installation methods.

    #32757

    AbZu
    Participant

    Recently went  through the procedure of adding the custom code to deal with the Endurance Page Cache scenario. After updating BPS Pro a message appeared notifying me that it requires additional BPS Custom Code setup steps to make sure everything is working correctly. At the moment I do not have a repeat of the issue I had previously and therefore assume that the message is simply informative.

    #32758

    AITpro Admin
    Keymaster

    @ AbZu – The EPC plugin Dismiss Notice just does a general check to let you know that the EPC must-use plugin is installed on your site and does not check anything additional, such as whether or not you have changed/modified the EPC htaccess code.  So if you have made mods or changes to your htaccess code then you can dismiss the EPC plugin Dismiss Notice.

    #32759

    AbZu
    Participant

    Thank you for your kind reply and confirmation.

    #33105

    Hannah
    Participant

    One of my sites just began displaying the EPC message in Admin. I do not see the code in the root htaccess file nor do I see a plugin folder or file in wp-content/plugins. The site is displaying as expected. Should I dismiss the message or add the EPC code to my custom code?

    #33107

    AITpro Admin
    Keymaster

    @ hannah – You probably want to do what the BPS check/message is recommending?  What is that exactly?  There are around 1,000 different checks/error messages in BPS.  Can you post the exact error message so I can make some sense of what you saying. Thanks/

    #33108

    Hannah
    Participant

    BPS Notice: The Endurance Page Cache (EPC) must-use plugin is installed
    The EPC must-use plugin has been automatically installed by your Web Host and requires additional BPS Custom Code setup steps to make sure everything is working correctly.
    Click this forum link: Endurance Page Cache Plugin Fix and do the Custom Code setup steps in the forum topic.
    If you want to disable the EPC plugin, see the “EPC Plugin Additional Notes” help section at the bottom of the forum topic.
    To Dismiss this Notice click the Dismiss Notice button below. To Reset Dismiss Notices click the Reset|Recheck Dismiss Notices button on the S-Monitor page.

    #33109

    AITpro Admin
    Keymaster

    Ok so you probably want to do whatever is recommended in the message or choose to do whatever else you want to do.

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

You must be logged in to reply to this topic.