I made application which has client which is hosted on netlify and server which is hosted on heroku .
to connect client with server i have included rule (i.e /* https://my_app.herokuapp.com/api/:splat 200) in _redirects file at the top .
after that I wrote general rule /* /index.html 200 this is working perfectly fine (i.e. I can use my application as i expected) .
But when i refresh page it shows Cannot GET /api/profile
I changed the order of rules of _redirects than I made observation that only first rule is working(i.e. when i wrote rule /* /index.html 200 at the top then there is no issue in refreshing but this time my client is not able to fetch data from server.)
It is showing two rules are processed when i deployed client on netlify.
Thanks @coelmay I understand what you explained but this time server is not connected to client properly.
Taking reference through documentation I also tried, https://client.netlify.app/* https://server.herokuapp.com/api/:splat 200 /* /index.html 200 but in this also /* /index.html 200 this rule is not working (i.e. when i refersh the page it says Cannot GET /api/something).
Can you provide another solution or any suggestion please.
Yeah, I got the logic behind the solution you offered but my client side uses http://client.netlify.app/user url to connect with server. It is not like https://client.netlify.app/api/user thats why i used multiple rules.