DEV Community

Thiago
Thiago

Posted on

2 1

SPA application error 404 on refresh

If you deploy your SPA application on a server as Godaddy or other service and try to access a url diferent from root folder as /about and has an error 404 you can try to solve your problem following this documentation from react:
https://create-react-app.dev/docs/deployment/

But the fast answer for your question is to create a .htaccess file on your server and past the following code:

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more