am not very clear on what you’re trying to do, but i’ll have a go
seems to me that you’re trying to add the “.html” at the end of the link name
Go to Settings > Permalinks and add the .html after the selected permalink
e.g.
instead of
/%year%/%monthnum%/%day%/%postname%/
have
/%year%/%monthnum%/%day%/%postname%.html/
to have https://localhost/wordpress/2009/02/23/sample-post.html/
Hope this helped ??