Hello,
I'm trying to do rewrites through my middleware to App router pages cohabiting with page router pages
I made a repo reproducing the issue : https://github.com/mparisot-antescofo/netlify
with a separate branch to add i18n to it : mparisot-antescofo/netlify#4
On the main branch all is behaving as expected:
rewrite to app router page : https://antescofo-test-netlify-rewrites.netlify.app/rewrite-app
redirect to app router page : https://antescofo-test-netlify-rewrites.netlify.app/redirect-app
rewrite to page route page : https://antescofo-test-netlify-rewrites.netlify.app/rewrite-page
redirect to page router page : https://antescofo-test-netlify-rewrites.netlify.app/redirect-page
But on the branch https://deploy-preview-4--antescofo-test-netlify-rewrites.netlify.app which add the i18n config, the rewrite to app router page returns a 404 while all the others work as expected : https://deploy-preview-4--antescofo-test-netlify-rewrites.netlify.app/rewrite-app
I tried to disable the language detection or forcing the url.locale before the rewrite thinking it might be the issue but I have the same results
Note that I added an additional app subdirectory to be able to separate page and app routed pages in other places of my code
thank you
Hello,
I'm trying to do rewrites through my middleware to App router pages cohabiting with page router pages
I made a repo reproducing the issue : https://github.com/mparisot-antescofo/netlify
with a separate branch to add i18n to it : mparisot-antescofo/netlify#4
On the main branch all is behaving as expected:
rewrite to app router page : https://antescofo-test-netlify-rewrites.netlify.app/rewrite-app
redirect to app router page : https://antescofo-test-netlify-rewrites.netlify.app/redirect-app
rewrite to page route page : https://antescofo-test-netlify-rewrites.netlify.app/rewrite-page
redirect to page router page : https://antescofo-test-netlify-rewrites.netlify.app/redirect-page
But on the branch https://deploy-preview-4--antescofo-test-netlify-rewrites.netlify.app which add the i18n config, the rewrite to app router page returns a 404 while all the others work as expected : https://deploy-preview-4--antescofo-test-netlify-rewrites.netlify.app/rewrite-app
I tried to disable the language detection or forcing the
url.localebefore the rewrite thinking it might be the issue but I have the same resultsNote that I added an additional
appsubdirectory to be able to separate page and app routed pages in other places of my codethank you