Closed iiison closed 6 years ago
Try connect-history-api-fallback
or express-history-api-fallback
.
The solution posted by @Shyam-Chen only works when you are using a tool like Browser Sync.
If using Apache, create a .htaccess
file in the root of your project directory with this:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^.*$ ./index.html
If using Nginx, add this to the .conf file related to your project (inside the "server" part):
location / {
try_files $uri =404;
try_files $uri $uri/ index.html;
}
Sounds like this is a backend issue, closing.
Hi, my browser shows 404 error if URL is not
/
. I know server should redirect all get requests with/
. I was wondering if this could be handled at Front-End level. Like react-router does.