Skip to content
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

Not able to test redirects with gatsby develop #9

Open
mattfelten opened this issue Jan 8, 2021 · 5 comments
Open

Not able to test redirects with gatsby develop #9

mattfelten opened this issue Jan 8, 2021 · 5 comments

Comments

@mattfelten
Copy link

I'm trying to add some redirects to my site and I see redirects getting created when running gatsby build, although they're a different format than the docs say. They look like <meta http-equiv="refresh" content="0; URL='/'" />

I'm not able to test that they're working correctly when running gatsby develop though. I get a 404. Is there a way to do this? Do I have the plugin misconfigured?

@dhakerShiv
Copy link
Owner

Hi @mattfelten,
Is is more likely that you have installed some other plugin as well for redirection and added that one as last in plugins list in gatsby.

Please remove other plugin if any for redirection and keep this one at last.

@modosc
Copy link

modosc commented Feb 23, 2021

fwiw i'm seeing the same thing locally

@smcgregor
Copy link

Same here. I placed the plugin last in the import order, but it still only behaves as expected after building the whole app. gatsby develop does not produce redirects.

@DirkLachowski
Copy link

@dhakerShiv Other plugins / plugin placement isn't the reason. Your page gen code runs in the onPostBuild api. That api is only available for production build runs (hence the name), not in the development server.

@chriszrc
Copy link

@DirkLachowski so is there any way to test redirects using develop locally?

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

6 participants