Skip to content

[Bug]: _redirects not working with netlify dev #1203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
naelkhann opened this issue Feb 7, 2022 · 3 comments
Closed
1 of 2 tasks

[Bug]: _redirects not working with netlify dev #1203

naelkhann opened this issue Feb 7, 2022 · 3 comments
Labels
status: awaiting user response type: bug code to address defects in shipped code

Comments

@naelkhann
Copy link

Summary

The _redirects file, which as per the docs should be placed in the /public/ dir is not evaluated when running your application using netlify dev.

When running netlify dev locally to run my app, redirects specified in the _redirects file worked and were evaluated. Now, they do not work.

Steps to reproduce

  1. Create a _redirects file. Add a valid redirect rule (you need a page defined in pages/ dir so you can redirect). For example:
/hello /{your_valid_page_route}
  1. Ensure your _redirects file is inside the /public directory.
  2. Run your Next js app using netlify-cli netlify dev.
  3. Navigate to the page {local_domain}/hello. The redirect will not work.

A link to a reproduction repository

No response

Plugin version

4.2.5

More information about your build

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

Mac OS

Your netlify.toml file

`netlify.toml`
# Paste content of your `netlify.toml` file here

Your public/_redirects file

`_redirects`
# Paste content of your `_redirects` file here

Your next.config.js file

`next.config.js`
# Paste content of your `next.config.js` file here. Check there is no private info in there.

Builds logs (or link to your logs)

Build logs
# Paste logs here

Function logs

Function logs
# Paste logs here

.next JSON files

generated .next JSON files
# Paste file contents here. Please check there isn't any private info in them
# You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.
@naelkhann naelkhann added the type: bug code to address defects in shipped code label Feb 7, 2022
@ajereos-circadence
Copy link

[[redirects]] and next config's async redirects() also not working for me

@sarahetter
Copy link

Is this still an issue?

@sarahetter
Copy link

Closing in favour of #1876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting user response type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants