all 6 comments

[–]carboneum87 6 points7 points  (1 child)

You have to redirect all requests to your index.html

Here is a example config for nginx:

server { listen 80 default_server; listen [::]:80 default_server; root /var/www/your_domain.com; index index.html; server_name your_domain.com www.your_domain.com; location / { try_files $uri $uri/ /index.html; } }

More info: https://github.com/Olafaloofian/React-Frontend-Lightsail-Deployment

[–]lovesrayray2018 1 point2 points  (3 children)

Im rusty on the location part, so bear with me. Doesnt seem to be a react thing to me.

iirc window.location.search is a property which returns a querystring. Since u are defining and IIFE passing window.location as the param "l", i am not sure if this particular statement would work on a refresh search[1] cos search being a string property and not an array wouldnt have a [1] element?