'How can I access a file in a folder in sharepoint if I only have a link to the "root folder" containing the file

I have a website that contains links to many files and sub-pages. Now I want to move all the files and sub-pages to sharepoint. Is it possible to just change the path for the root folder and then access the files relative to there? E.g.

Old path:

`https://example.com/rootfolder/folder/test.htm`

To a new path like

`https://example.sharepoint.com/:f:/test/EtOuQZFuFOhtjVh6IMhx8B4RU5HeiTq1oEf-WrGamGg?e=JhWURB/folder/test.htm`

So that the relative path is preserved?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source