I've used a really nice sitemap generator for over a decade to help me control what pages/directories get listed. It is a perl script and lives in the cgi-bin. The site has changed to https and it still works fine except that it generates http: pages in the sitemaps, even though you can't load the page as http: in a browser.
I am tempted to add the rewrite rules that I have in the root directory, but because it is within a folder in the cgi-bin I am hesitant. It is not a "get" request, it does not even show anything in the logs when I force it to run (by deleting the existing sitemap) so I don't see htaccess rewrites as being the right fix.
The script is at example.com/cgi-bin/sitemap/ and this is the code in the root directory .htaccess that lets me force generation of a new sitemap.xml and sitemap.txt file when I visit example.com/sitemap.txt
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^sitemap\.(txt|xml)$ cgi-bin/sitemap/sitemap.pl [L]
The developer is long retired. I suppose I should look for a different solution but it is only for a few auxiliary pages on an otherwise WP site. Sooner or later I'll need to either fix or replace this little gem as other hobby/info type sites end up https too. Just asking here in case someone knows a way to instruct the script?