WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
htaccess conflict with BulletProof Security (4 posts)

  1. AITpro
    Member
    Posted 3 years ago #

    hey guys,
    A user notified me that there is a minor htaccess conflict going on with BulletProof Security and WP Super Cache.
    When using mod_rewrite to serve cache files. (Recommended) the WPSC htaccess code is being written appended to the end of the root htaccess file instead of being written to the top of the htaccess file so this will require that the appended code be cut from the end of the root htaccess file and pasted to the top of the root htaccess file. The Begin WordPress to End WordPress code also needs to be cut and pasted with the WPSC code (cut and paste all the code both WPSC and the WordPress rewrite code) to the top of root htaccess file. If you update the WPSC rules again the Begin WordPress to End WordPress htaccess code will need to be cut and pasted again to the top of the root htaccess file. Thanks.

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Supercache grabs the WordPress rules and writes its own rules above those rules so I'm not sure what's happening with BulletProof.

    Does this problem happen regardless of which order the plugins write to the .htaccess?

  3. AITpro
    Member
    Posted 3 years ago #

    Yep it looked like that is what was going on with the WordPress rules. BPS actually allows users to automatically create their htaccess files with an fwrite that creates an entirely new htaccess file or uses one of the pre-made master files instead of appending / writing to an existing htaccess file. So basically BPS overrides Super Cache completely if BPS htaccess files are activated or reactivated after WP Super Cache settings are changed or modified in regards to mod_rewrite. :( I originally started out having the htaccess coding appended, but this turned out to be a huge nightmare due to people not having custom permalinks set up and some other issues so i switched over to having the htaccess file created for them automatically. A warning notification is displayed until they set up custom permalinks. I could write an exception for WP Super Cache, but I think the smarter and simpler approach to avoid any future issues is just to have Super Cache write to the top / beginning of the htaccess file instead of appending to the bottom. I will then make any necessary coding changes on my end so that BPS and WPSC will play nicely together - creating a notification that WPSC settings need to be saved again with a link to the WPSC settings page and whatever else needs to be done. I would just grab your htaccess code, but this could be problematic if people change their WPSC settings at some point so I think just a notification that WPSC settings need to be saved again if BPS is reactivated after WPSC. This seems like the best way to ensure that things are all working together correctly. And not a big inconvenience either - 1 warning notification and 2 clicks. If you have a better idea let me know. Thanks.

  4. AITpro
    Member
    Posted 3 years ago #

    hmm looking at your coding you do have fopen w so I'm not sure why your code is not being written to the beginning of the htaccess file. In any case in the next release of BPS i will just add a warning message for people who are using WPSC with mod_rewrite enabled. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic