Map an old URL to a new file

Nextcloud version (eg, 20.0.5): 21.0.5
Operating system and version (eg, Ubuntu 20.04): Linux 5.4.0-88-generic #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 x86_64
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.41
PHP version (eg, 7.4): 7.4.3

Hi there.

A user saved a file on our Nextcloud. The URL for that file was later posted on multiple websites.
By user error, the file was deleted, so it had to be created again, and now it has a different URL associated with it.

How can we assign the original URL to this new file?

Thanks in advance.

I think it is not possible. Perhaps it is possible to manipulate the database e.g. MariaDB.

For further problems:
Till Nextcloud 17 there was an app ShareRenamer. Today you can use Sharing Path. But there is the username in the path included. Personally i use a php redirct on a different subdomain for redirect real names to nextcloud shares.

1 Like

You could configure the Webserver to permanently redirect (301) the old url to the new one.