Good Day All,
I'm trying to use urlrewrite to forward all links back to index.html to avoid the 500 error when a page in the app is refreshed. I have searched high and low and the examples I find are not working for me. Would anyone mind providing some feedback on the code below? Thanks!
~~ AngularJS Router ~~
app.config(['$urlRouterProvider'
, '$stateProvider'
, '$locationProvider'
, function ($urlRouterProvider, $stateProvider, $locationProvider) {
$locationProvider.html5Mode(true);
}]);
~~ index.html ~~
<base href="/index.html" />
~~ web.xml ~~
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
<param-name>logLevel</param-name>
<param-value>DEBUG</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
~~ urlrewrite.xml ~~
<urlrewrite default-match-type="wildcard">
<rule>
<from>home/**</from>
<to>index.html</to>
</rule>
<rule>
<from>public/**</from>
<to type="redirect">index.html</to>
</rule>