B
B
b35894312016-04-08 15:29:03
React
b3589431, 2016-04-08 15:29:03

What is the correct way to use react-router?

The project required the use of react-router. Without reloading the page, everything works just fine. Pretty URLs using browserHistory. But it is required to "save" the page addresses so that you can go directly to the links. The reason for this phenomenon is clear, but I can not solve the problem. For example, googled - brinidesigner.com/react-router-example-with-es6 In this case, the .htaccess file is used to redirect to the root URL. In my case, there is no Apache, only nginx, therefore it is possible to register redirects only directly to nginx, but this is far from being a front-end and it will be quite difficult to transfer the project. How to solve this problem correctly and beautifully?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2016-04-08
@b3589431

Like it or not, the server should be able to return the desired page to the requested address, and not 404, even if in fact it is the same HTML in which you then draw the desired JS. Therefore, one cannot do without a server configuration.

and it will be quite difficult to transfer the project.
why? I have nginx configs in my turnips along with the rest of the code, very convenient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question