Up until now, our website consisted of a wiki with several wiki sites. We now decided to host some general information on a single page and move the wiki to a subdomain (
https://wiki.example.com/). I want to redirect nearly all requests from
https://wiki.example.com/XYZ, only requests to
https://example.com/index.php should not be redirected.
The idea here is that people who have bookmarks to
https://example.com/FOO get redirected to the correct page at
https://wiki.example.com/FOO as well as people who come from search engines.
How can I achieve this with nginx?