I found today some odd things on my website’s htaccess while I was trying to ban an ip address.
But in order to understand what is the odd thing I have to tell you the story from the very beginning.
In order to migrate my website from WP to CP I had to downgrade to the WP version 4.9 instead of the 5.1 that it had been upgraded. And that because the migration plugin didn’t work on the v 5.1 at this particular point.
In order to do so I used one of backup snapshot of my website.
I did the migration successfully with only a minor update problem due to the lack of a library but all else worked perfectly fine.
So today while I was trying to ban an unwanted ip address I opened the htaccess file to edit it and I found nothing else but this. This is the htaccess of the current CP installation.
> # BEGIN WordPress
> # END WordPress
No problem with that, I can add whatever is missing.
So I went back to my backup in order to remember what else I had add to my htaccess ( not that many things either way. Just a couple of IPs).
And I found this in the htaccess of the last WP installation of 5.1 version 5.1
Yoast SEO - XML Sitemap Rewrite Fix
RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]
RewriteRule ^locations.kml$ /index.php?sitemap=wpseo_local_kml [L]
RewriteRule ^geo_sitemap.xml$ /index.php?sitemap=geo [L]
RewriteRule ^([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 [L]
END Yoast SEO - XML Sitemap Rewrite Fix
Can someone explain to me what is this? Where did it come from? Why was automatically recorded in the WP htaccess ( I didn’t write it myself) and if is of course needed it in my current CP installation?