react-router icon indicating copy to clipboard operation
react-router copied to clipboard

Rendering "non-root" urls

Open benbonnet opened this issue 11 years ago • 3 comments

Using simple client rendering.

Calling the root url of the app, everything works fine.

Calling a non-root url (ex. http://localhost:xxx/myurl) right away in the browser, I get a Cannot get '/myurl error. In production, it works fine though, I get what's expected if I hit http://mydomain/myurl if accessed right away

In development, hitting http://localhost:xxx/#/myurl works

I'm left with a big misunderstanding; if anyone could provide some enlightments, that'd be super-cool

Best

benbonnet avatar Oct 17 '15 08:10 benbonnet

I'm getting the same message. "Cannot GET /about" when I try to enter http://localhost:9004/about into the address url. On my homepage when I click on the link to About page, the page is rendered fine. When I enter the link into the address bar, I get the error. When I don't use history = {createHistory()}, the site works fine with hashes.

Good to know it's not just me

nslobodchuk avatar Oct 17 '15 13:10 nslobodchuk

https://github.com/rackt/react-router/blob/v1.0.0-rc3/docs/guides/basics/Histories.md#configuring-your-server

taion avatar Oct 17 '15 14:10 taion

:+1:

benbonnet avatar Oct 17 '15 17:10 benbonnet