whenever I enter the URL http://domain.de/beta/ to my browser, I can see the content of Verein. If I press F5 to refresh the page, I get an 404 Not-Found error.
I'm using the BrowserRouter from react-router-dom (v.5.2.0 > I checked the docs too and just follow the example).
// inside my index.js of Create-React-App render( <React.StrictMode> <BrowserRouter basename="/beta"> <Switch> <Route path="/verein/contact-imprint-privacy" component={ContactImprintPrivacy} /> <Route path="/verein" component={Verein} /> <Route exact path="/"> <Redirect to="/verein" /> </Route> <Route path="*" component={FourOhFour} /> </Switch> </BrowserRouter> </React.StrictMode>, document.getElementById("root") ); I run yarn build and deploy the web app from build folder to my hosting space. What do I miss for the page refresh?
Update, 11.07:
I have to think about how the server side should handle the URL. So, I add an .htaccess file with a rewrite rule.
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /beta RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule . /beta/index.html [L] </IfModule>