react-redux-universal-hot-example icon indicating copy to clipboard operation
react-redux-universal-hot-example copied to clipboard

Server return status 200 while redirecting page

Open fullyfaltu opened this issue 9 years ago • 1 comments

I'm using react-router to redirect page. Here is what I am doing: this.context.router.replace('cats');

It redirects page but responds 200 OK code. I want 301 code if page is redirected. How can I fix this thing?

fullyfaltu avatar Dec 22 '16 12:12 fullyfaltu

The server uses redirect method of express (https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/server.js#L86), the default status is 302, I get the status 302.

If you use my fork with service worker, you have a status 200 because the response is provided by the service worker.

bertho-zero avatar Dec 22 '16 18:12 bertho-zero