Forum Discussion
SharePoint Online file preview page always redirects back to library - chance of custom backlink?
Unfortunately, it is not currently possible to define a custom backlink (external link removed by moderator) /parent for the SharePoint Online file preview page. The behavior you are experiencing is by design, and there is no supported way to change it.
Manually changing the ?parent= parameter is not a supported method and can lead to errors, as you have already experienced.
If you need to navigate back to a specific location after previewing a file, you could consider opening the file in a separate window or tab instead of using the preview feature. Alternatively, you could add a link to the desired location in the file's description or metadata, so that users can easily navigate back to it after previewing the file.
It's also worth noting that Microsoft frequently updates SharePoint Online with new features and functionality, so it's possible that this behavior could change in the future.