For brevity, filenames include parent directory(s). - substitutes /.
If installing Strapi fresh, and you're a filthy, untyped rotten scoundrel, remember to add compilerOptions.jsx = "react" as shown below in jsconfig.json to avoid the IDE SquiggleMonster.
npx create-strapi-app@latest --quickstart --no-run strapi-dashborednpm run strapi generate- choose "middleware"
- choose "Add middleware to root of project"
- edit
src/middlewares/redirect.js - edit
config/middlewares.js