I'm migrating an old site to a new structure, and have a bunch of these type rewrites:
location / {
rewrite ^/foo.html /legacy-page? permanent;
rewrite ^/bar.html /legacy-page? permanent;
rewrite ^/org.html /legacy-page? permanent;
rewrite ^/directory/foo.html /legacy-page? permanent;
rewrite ^/directory2 /legacy-page? permanent;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
Is there a better / more efficient way to handle those /legacy-page rewrites?