'Path base routing - react Children route not working

Children routing not loading. I have following configuration in .htaccess file

RewriteEngine On RewriteBase %{ENV:REACT_APP_SUBPATH}/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule . **/%{ENV:REACT_APP_SUBPATH}/**index.html [L] In index.tsx file we mention that BrowserRouter basename=${ENV:REACT_APP_SUBPATH}

It is working for parent routes but children routes its not working means http://sample.com/account -> this is working http://sample.com/account/create -> this is not working it showing blank pages.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source