0

I host mine react project to Namecheap server. It's working fine, but when I go to about or other pages and reload this page the page is gone and it shows me a 404 error. why did I get a 404 error and how to fix it?

1 Answers1

0

Create a .htaccess file on your root folder and paste the following code

 <IfModule mod_rewrite.c>
    RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.html$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-l
      RewriteRule . /index.html [L]
    </IfModule>