I'm deploying a v4 site to Netlify and am trying to include a Netlify _redirects file, which of course is ignored by Middleman. I tried manually copying the file during build, but it gets removed before build finishes.
Try to ignore them, additionally to manually copy them during build.https://middlemanapp.com/advanced/dynamic-pages/#ignoring-files
You can use a proxy to rename a netlify_redirects file (or whatever name you want) to _redirects on build: https://github.com/middleman/middlemanapp.com/blob/master/config.rb#L27
Thanks for the replies.
@tysongach That worked like a charm.
Sorry, why you need to use netlify redirects with Middleman?
I'm putting in production my site in these days with Middleman / Netlify / NetlifyCMS so I'm curious to see if I can find problems
I redesigned a site and wanted to preserve the old URLs so visitors wouldn't get 404 pages.
It is not possible set this in Middleman, like for me:
redirect "index.html", to: "/it/index.html"
Yes, it is possible to use redirect in Middleman. But, that only creates an html file with a refresh meta tag:
It's better to let Netlify do a proper 301 redirect for search optimization purposes. There is a warning in the Middleman docs: