.htaccess conflict causing very high cpu usage

I have a Wordpress installation and I imported it from a YII 1.0 site, so I wanted to preserve the links and the developer made this .htaccess file, but it seems there is a conflict in it.
When I moved the site to a new server, it deleted the old .htaccess file and the site run fine for 12 hours, but when I added the rewrite rules, the CPU and Memory consumption started to rise very fast, as you can see in the charts below.

Could you please help me find the conflict in these rules?

#WFIPBLOCKS - Do not remove this line. Disable Web Caching in Wordfence to remove this data.<br />
Order Deny,Allow<br />
#Do not remove this line. Disable Web Caching in Wordfence to remove this data - WFIPBLOCKS<br />
#WFCACHECODE - Do not remove this line. Disable Web Caching in Wordfence to remove this data.<br />
<IfModule mod_deflate.c><br />
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json<br />
<IfModule mod_headers.c><br />
Header append Vary User-Agent env=!dont-vary<br />
</IfModule><br />
<IfModule mod_mime.c><br />
AddOutputFilter DEFLATE js css htm html xml<br />
</IfModule><br />
</IfModule><br />
<IfModule mod_mime.c><br />
AddType text/html .html_gzip<br />
AddEncoding gzip .html_gzip<br />
AddType text/xml .xml_gzip<br />
AddEncoding gzip .xml_gzip<br />
</IfModule><br />
<IfModule mod_setenvif.c><br />
SetEnvIfNoCase Request_URI \.html_gzip$ no-gzip<br />
SetEnvIfNoCase Request_URI \.xml_gzip$ no-gzip<br />
</IfModule><br />
<IfModule mod_headers.c><br />
Header set Vary &quot;Accept-Encoding, Cookie&quot;<br />
</IfModule><br />
<IfModule mod_rewrite.c><br />
#Prevents garbled chars in cached files if there is no default charset.<br />
AddDefaultCharset utf-8<br />
#Cache rules:<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{HTTPS} on<br />
RewriteRule .* - [E=WRDFNC_HTTPS:_https]<br />
RewriteCond %{HTTP:Accept-Encoding} gzip<br />
RewriteRule .* - [E=WRDFNC_ENC:_gzip]<br />
RewriteCond %{REQUEST_METHOD} !=POST<br />
RewriteCond %{HTTPS} off<br />
RewriteCond %{QUERY_STRING} ^(?:\d+=\d+)?$<br />
RewriteCond %{REQUEST_URI} (?:\/|\.html)$ [NC]<br />
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|wf_logout|wordpress_logged_in|wptouch_switch_toggle|wpmp_switcher) [NC]<br />
RewriteCond %{REQUEST_URI} \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$<br />
RewriteCond &quot;%{DOCUMENT_ROOT}/wp-content/wfcache/%{HTTP_HOST}_%1/%2~%3~%4~%5~%6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}&quot; -f<br />
RewriteRule \/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)\/*([^\/]*)(.*)$ &quot;/wp-content/wfcache/%{HTTP_HOST}_$1/$2~$3~$4~$5~$6_wfcache%{ENV:WRDFNC_HTTPS}.html%{ENV:WRDFNC_ENC}&quot; [L]<br />
</IfModule><br />
#Do not remove this line. Disable Web caching in Wordfence to remove this data - WFCACHECODE<br />
RewriteEngine on<br />
    RewriteCond %{HTTP_HOST} ^moldovacrestina\.md$ [OR]<br />
    RewriteCond %{HTTP_HOST} ^www\.moldovacrestina\.md$<br />
    RewriteRule ^tv$ &quot;https\:\/\/www\.youtube\.com\/user\/MoldovaCrestinaTV&quot; [R=301,L]<br />
# Use PHP5.4 Single php.ini as default<br />
#AddHandler application/x-httpd-php54s .php<br />
#deny from all<br />
#allow from 178.168.73.217<br />
RewriteBase /<br />
#romana<br />
RewriteRule ^biblie\.html$ /raspunsuri-din-biblie/ [L,R=301]<br />
RewriteRule ^despre\.html$ /despre-mine/ [L,R=301]<br />
RewriteRule ^news$ /stiri/? [L,R=301]<br />
RewriteRule ^blogosfera$ /blogosfera/ [L,R=301]<br />
RewriteRule ^asteapta\.html$ /dragostea-asteapta/ [L,R=301]<br />
RewriteRule ^dviata/index$ /dreptul-la-viata/ [L,R=301]<br />
RewriteRule ^video/(.*)$ /tv/ [L,R=301]<br />
RewriteRule ^Raspunsuri-din-Biblie/(.*)\.html$ /$1 [L,R=301]<br />
RewriteRule ^news/(.*)\.html$ /$1 [L,R=301]<br />
RewriteRule ^blog/(.*)\.html$ /$1 [L,R=301]<br />
RewriteRule ^implicare\.html$ /implicare [L,R=301]<br />
RewriteRule ^about_us\.html$ /about-us [L,R=301]<br />
RewriteRule ^bibleAnswers/AnastasiaFilat$ /author/filat.nastica [L,R=301]<br />
RewriteCond %{QUERY_STRING} ^alias=(.*)$<br />
RewriteRule ^dviata/item?$ %1? [R=301,L]<br />
RewriteCond %{QUERY_STRING} ^alias=(.*)$<br />
RewriteRule ^asteapta/item?$ %1? [L,R=301]<br />
RewriteCond %{QUERY_STRING} ^alias=(.*)$<br />
RewriteRule ^newsRu/item?$ %1? [L,R=301]<br />
RewriteCond %{QUERY_STRING} ^alias=(.*)$<br />
RewriteRule ^blogosferaRu/item?$ %1? [L,R=301]<br />
RewriteCond %{QUERY_STRING} ^alias=(.*)$<br />
RewriteRule ^blogosferaEn/item?$ %1? [L,R=301]<br />
#rusa<br />
RewriteRule ^russian$ /ru/%d0%be%d1%82%d0%b2%d0%b5%d1%82%d1%8b-%d0%b8%d0%b7-%d0%b1%d0%b8%d0%b1%d0%bb%d0%b8%d0%b8/ [L,R=301]<br />
RewriteRule ^newsRu$ /ru/???????/ [L,R=301]<br />
RewriteRule ^blogosferaRu$ /ru/??????????/ [L,R=301]<br />
RewriteRule ^russian/item/(.*)\.html$ /$1 [L,R=301]<br />
#RewriteRule ^newsRu/item?alias=(.*)$ /$1 [L,R=301]<br />
#RewriteRule ^blogosferaRu/item?alias=(.*)$ /$1 [L,R=301]<br />
RewriteRule ^videoRu$ /tv/ [L,R=301]<br />
#engleza<br />
RewriteRule ^main/homeEn$ /en/ [L,R=301]<br />
RewriteRule ^admin$ /wp-admin/ [L,R=301]<br />
RewriteRule ^rss.php$ /feed/ [L,R=301]<br />
RewriteRule ^english$ /en/ [L,R=301]<br />
RewriteRule ^newsEn$ /en/ [L,R=301]<br />
RewriteRule ^blogosferaEn$ /en/ [L,R=301]<br />
RewriteRule ^english/item/(.*)\.html$ /$1 [L,R=301]<br />
RewriteRule ^blogosferaEn/item?alias=(.*)$ /$1 [L,R=301]<br />
RewriteRule ^newsEn/(.*)$ /$1 [L,R=301]<br />
RewriteRule ^english/(.*)/(.*) /$2 [L,R=301]<br />
#franceza<br />
RewriteRule ^french/$ /fr/ [L,R=301]<br />
RewriteRule ^french/item/(.*)\.html$ /$1 [L,R=301]<br />
#spaniola<br />
RewriteRule ^spaniola/$ /es/ [L,R=301]<br />
RewriteRule ^spaniola/item/(.*)\.html$ /$1 [L,R=301]<br />
#users<br />
RewriteRule ^bibleAnswers/VasileFilat$ /author/vasile-filat/ [L,R=301]<br />
#general<br />
RewriteRule ^BibleAnswers/item/([0-9]+)$ /links.php?id=$1 [L,R=301]<br />
RewriteRule ^(.*)/([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ /$5 [L,R=301]<br />
#RewriteRule ^(.*)/([a-zA-Z]+)/(.*)$ /$3 [L,R=301]<br />
RewriteRule ^(.*)/(.*)\.html$ /$2 [L,R=301]<br />
RewriteRule ^(.*)(Á|á|Â|â|Æ|æ|À|à|Å|å|Ã|ã|Ä|ä|A)(.*)$ $1a$3 [E=Redirect:1,N,R]<br />
AddDefaultCharset UTF-8<br />
# BEGIN WordPress<br />
<IfModule mod_rewrite.c><br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteRule ^index\.php$ - [L]<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
</IfModule><br />
# END WordPress<br />
AddDefaultCharset UTF-8<br />
# BEGIN EWWWIO<br />
# END EWWWIO<br />
# BEGIN WP-HUMMINGBIRD-CACHING<br />
# END WP-HUMMINGBIRD-CACHING</p>
<p>Options -Indexes</p>
<p># Wordfence WAF<br />
<IfModule mod_php7.c><br />
php_value auto_prepend_file '/var/www/moldovacrestina.md/wordfence-waf.php'<br />
</IfModule><br />
<Files &quot;.user.ini&quot;><br />
<IfModule mod_authz_core.c><br />
Require all denied<br />
</IfModule><br />
<IfModule !mod_authz_core.c><br />
Order deny,allow<br />
Deny from all<br />
</IfModule><br />
</Files><br />
# END Wordfence WAF<br />
    Luís

    Hi David ,

    Hope you're doing well today!

    If the CPU consumption was noted after place the .htaccess, then something can be interfering.

    You have a lot of rules and some of them are related to your setup, which turns hard to find, also, the changes may not be noted instantaneously.

    Just to make sure, you don't have all the "< /br " tags in the .htaccess, right?

    I flagged the SLS team (our code experts ) to get their valuable feedback.

    Since this team deals with more advanced threads it may take them longer to reply.

    Cheers, Luís

    Mahlamusa

    Hello David,

    I hope you are having a great day so far. I hope this finds you in time and that it helps you in the configuration of your website.

    Although I cannot fix the .htaccess for you but I have used some tools to find some possible issues in your code. I hope this helps you point out and get rid of any issues that may slow down your site and cause high CPU usage.

    First I copied the code and removed the '
    ' tags and then pasted the code into Notepad++. Please paste the code in a text or code editor so that you know which lines are those as I will refer to line numbers below.

    Line 2. 'Fatal error: not allowed here'. Usually this is applied inside a <directory> rule
    2: Order Deny,Allow

    Line 25: Fatal Error: "envclause should be in the form env=envar"
    25: Header set Vary "Accept-Encoding, Cookie"

    Line 32, 55, 117. Fatal RewriteBase: 'Only valid per-directory config files'. Please double check if you have to use this rule multiple times in the file, in most cases it is added once above all rules that need it.

    32: RewriteBase /
    55: RewriteBase /
    117: RewriteBase /

    Line 129, 130: Fatal error: Options> not closed, <p> not closed. Try to verify if these tags are required here or used properly.

    129: <p>Options -Indexes</p>
    130: <p># Wordfence WAF

    I think the HTML <p> tag is there by mistake and it may cause problems please try to rewrite line 129 and 139 as follows:

    129:  Options -Indexes
    130: # Wordfence WAF

    During my test, I found that most of the rewrite conditions are not met but I am not sure what implications that would have in the performance of your site but it is worth looking at. An example of such a condition is:

    These rules were not met

    30: RewriteRule ^biblie\.html$ /raspunsuri-din-biblie/ [L,R=301]
    31: RewriteRule ^despre\.html$ /despre-mine/ [L,R=301]
    .
    .
    42: RewriteRule ^bibleAnswers/AnastasiaFilat$ /author/filat.nastica [L,R=301]

    Also some of the rules were added by the Wordfence plugin and may have changed since the plugin has been updated many times by now.

    I hope you find this useful. Please do let us know if any of this was helpful and whether you got this issue resolved or not.

    Please enjoy your day further.

    Cheers,
    Mahlamusa