0

I'm getting a blank page on every route in my app, not sure if it's the Router config issue or Tomcat config issue. Console does show all resources and built scripts, as well as the app title but the pages are blank.

App config:

package.json

"homepage": "/mpk-standalone",

App.js

import { BrowserRouter, Route, Routes } from 'react-router-dom'
            <BrowserRouter
                basename='/mpk-standalone'>
                <Routes>
                 //etc.

Tomcat config:

Tomcat 9.0\webapps\mpk-standalone\META-INF\context.xml

<?xml version="1.0" encoding="UTF-8"?>

<Context>  
  <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
</Context>

Tomcat 9.0\webapps\mpk-standalone\WEB-INF\rewrite.config

RewriteRule ^/elapp/(.*)$    /index.html [L]

I googled a lot and searched on StackOverflow as well, all answers say that this config should work. But it doesn't for me. Is it wrong somehow?

1
  • You did not provide the rewrite condition. However, the rule writes all the /elapp/... URLs to /index.html (further rule application is stopped by the 'L' flag which means if there are other rules after this, they will not be applied). Not sure if this is intentional. Check the HTML if the URLs are being written appropriately. Commented Aug 31 at 8:19

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.