I moved WordPress out of the root of my server into a special folder of its own and now Google is indexing my posts together with that special WordPress folder thus creating some 404 error issues.
For example let's say my WordPress core files are installed in
https://www.example.com/wordpress/ but the home page is
This post link
https://www.example.com/hello-world/435/ works fine and has been indexed by Google. Unfortunately, Google is also indexing
https://www.example.com/wordpresshttps://www.example.com/hello-world/435/ thus creating 404 errors in Google Search console.
So my question is, is there a way to use
.htaccess to make links like
https://www.example.com/wordpresshttps://www.example.com/hello-world/435/ to redirect to the right link which is