urlrewrite, angularjs and GAE

55 views
Skip to first unread message

d...@buckup.biz

unread,
Jun 6, 2015, 6:07:32 AM6/6/15
to urlre...@googlegroups.com
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>
</urlrewrite>





Reply all
Reply to author
Forward
0 new messages