angular html5mode in tomcat apache 8.5.4 gives 404 on page refresh

后端 未结 2 416
走了就别回头了
走了就别回头了 2021-01-01 03:47

I m creating war file using gulp-war and deploy it into tomcat apache server 8.5.4 on my system

it first runs on localhost:8080/projectName/

but

2条回答
  •  死守一世寂寞
    2021-01-01 04:26

    This is example for The global approach :

    
    
    
        
        
        
    
        
        
        
        
        WEB-INF/web.xml
    
        ${catalina.base}/conf/web.xml
    
    

    And Just jave added two most popular extensions to your list:

    RewriteCond %{REQUEST_URI} !^.*\.(bmp|css|gif|htc|html?|ico|jpe?g|js|pdf|png|swf|txt|xml|svg|eot|woff|woff2|ttf|map|json)$
    RewriteRule ^(.*)$ /index.html [L]
    

    I like reverse approach (comment by ) but prefer to keep it clean and readable.

提交回复
热议问题