Skip to content

Local Netlify Dev: redirects not working #583

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
samajammin opened this issue Oct 23, 2019 · 1 comment
Closed

Local Netlify Dev: redirects not working #583

samajammin opened this issue Oct 23, 2019 · 1 comment

Comments

@samajammin
Copy link

Hey folks! First off, thanks for building this great tool.

- Do you want to request a feature or report a bug?
Bug

- What is the current behavior?

TL;DR: my redirects work on deploys but not in my local environment

I'm trying to add redirects to the site via netlify.toml:

[[redirects]]
  from = "/old-path"
  to = "/new-path"

When I run netlify dev locally, the redirect doesn't work. The URL returns a 304 code, then displays the 404 page.

I pushed this same change & opened a PR:
ethereum/ethereum-org-website#337
The redirect works in my deploy preview.

- If the current behavior is a bug, please provide the steps to reproduce.

  1. Clone my branch
  2. run netlify dev
  3. Access the URL (http://localhost:8080/old-path)
  4. The site stays on http://localhost:8080/old-path

- What is the expected behavior?
Accessing the URL http://localhost:8080/old-path should 301 redirect to http://localhost:8080/new-path

- Local Environment Information
Paste the results of netlify status --verbose here

 netlify status --verbose
──────────────────────┐
 Current Netlify User │
──────────────────────┘
Name:  Sam Richards
Teams:
  Sam Richards's team: Collaborator
  ethereum:            Collaborator

────────────────────┐
 Environment Info   │
────────────────────┘

  System:
    OS: macOS 10.15
    CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
  Binaries:
    Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.13.0/bin/npm
  Browsers:
    Chrome: 77.0.3865.120
    Safari: 13.0.2

────────────────────┐
 Netlify Site Info  │
────────────────────┘
Current site: ethereumorg
Netlify TOML: /Users/samrichards/code/ef/ethereum-org-website/netlify.toml
Admin URL:    https://app.netlify.com/sites/ethereumorg
Site URL:     https://ethereum.org

@samajammin
Copy link
Author

This actually works when I access the site from port 8888 instead of 8080 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant