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

What's the current state of support for URL rewriting? #3113

Closed
ghost opened this issue Dec 3, 2017 · 2 comments
Closed

What's the current state of support for URL rewriting? #3113

ghost opened this issue Dec 3, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 3, 2017

We're trying to serve some Gatsby pages by using Nginx to rewrite the page URLs, but it seems that Gatsby depends on the page URL to reference a direct path on disk--I get the following console errors when I then try to access these sites (we're rewriting URLs such as /hotels-ng?district=1234 to page directory paths such as public/district_1234):

A page wasn't found for "/hotels-ng"
loader.js:259:8
A page wasn't found for "/404.html"

I saw that a similar question about path rewriting was raised in #383 but that issue is over a year old and the advice there seems to be outdated, so I figured that I'd raise it again. Like, is this the new example that I should be following? Looking for any guidance really. Thanks!

@KyleAMathews
Copy link
Contributor

When you're working with a static site generator — you need to create paths which correspond to file directories.

Why not just make urls like /hotels-ng/district/1234/?

@ghost
Copy link
Author

ghost commented Dec 3, 2017

We could. I can see how this could call for pushing back on the URL structure. Thanks for the quick reply.

This issue was closed.
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