How to use react router (createBrowserHistory) on Microsoft IIS to make routing working?

后端 未结 6 1687
情深已故
情深已故 2020-12-03 08:54

I am using react-router (createBrowserHistory) for my react app.

Below is my code of

var ReactDOM = require(\'react-dom\') ;

var ReactRouter = req         


        
6条回答
  •  被撕碎了的回忆
    2020-12-03 08:54

    I've struggled with this a little bit so I write it for the next person: First update the web.config file (as Bo Chen mentioned).

     
        
          
            
              
              
                
                
                
              
              
            
          
        
    

    This will find every request and rewrite it to /index.html instead.

    So you need to have a index.html in the root of your project. Also pay attention to the extension of the file.

提交回复
热议问题