score:0

add a web.config file with following code-

<?xml version="1.0"?>
<configuration>
 <system.webserver>
 <rewrite>
 <rules>
 <rule name="react routes" stopprocessing="true">
 <match url=".*" />
 <conditions logicalgrouping="matchall">
 <add input="{request_filename}" matchtype="isfile" negate="true" />
 <add input="{request_filename}" matchtype="isdirectory" negate="true" />
 <add input="{request_uri}" pattern="^/(api)" negate="true" />
 </conditions>
 <action type="rewrite" url="/" />
 </rule>
 </rules>
 </rewrite>
 </system.webserver>
</configuration>

score:3

i am able to fix this. the issue is not with react. it is with digitalocean.

i have to set catchall at app spec by doing this

using cloud panel ui: log in and click on app > settings >> click on component name > scroll down to custom page > edit custom page and select catchall > enter index.html in the page name block > save


Related Query

More Query from same tag