Plugin Author
AITpro
(@aitpro)
if ( preg_match( $pattern, $check_string, $flush_matches ) ) {
$stringReplace = preg_replace('/\n#\sBEGIN\sWordPress\s*<IfModule\smod_rewrite\.c>\s*RewriteEngine\sOn\s*RewriteBase(.*)\s*RewriteRule(.*)\s*RewriteCond((.*)\s*){2}RewriteRule(.*)\s*<\/IfModule>\s*#\sEND\sWordPress\n/s', "", $check_string);
file_put_contents($filename, $stringReplace);
}
What this means is the default WordPress Rewrite code exists in the root htaccess file, but since the file is locked it cannot be automatically removed. Check if this code below has been saved to any Custom Code text boxes and delete it, click the Save Root Custom Code button, go to the BPS Security Modes page, click the Create secure.htaccess File AutoMagic button and activate root folder BulletProof Mode.
# BEGIN WordPress
<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
Problem solved. Thank you very much!
Plugin Author
AITpro
(@aitpro)
Very welcome. I am pretty sure we are going to do this in a future version of BPS: automatically unlock the root htaccess file, remove that code if it exists, lock the root htaccess file again. Then do an additional separate inpage Custom Code check and display a message for that – “X exists in Y do Z”.
Hi,
I got the same problem but the code snippet that VesperaWebDesigns deleted is needed in my case by W3 total cache or else it starts to complain it doesnt know what fancy links I’m using.
How do i solve this?
Thank you for your help.
Plugin Author
AITpro
(@aitpro)
BPS already has/uses the standard WordPress htaccess code (the same code that W3TC is complaining is not there). It is incorporated into the standard BPS root htaccess file code, but is in a different format so W3TC does not see it. You can just remove/delete the default WordPress Rewrite htaccess code and dismiss/hide the W3TC displayed message.
https://ww.wp.xz.cn/support/topic/new-update-and-w3tc-permalinks-issue?replies=8
The standard WordPress Rewrite code
# BEGIN WordPress
<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 root htaccess file incorporates the standard WordPress Rewrite code
# WP REWRITE LOOP START
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
...
...
BPS security code between the START and END code
...
...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# WP REWRITE LOOP END
Ok, I’ve deleted the standard WordPress Rewrite code and hidden the eror message in W3TC.
Thank you for the feedback and help.