Search Engine Friendly urls in App Engine - Java

2019-04-17 10:15发布

I need to create search engine friendly URL in my Google App Engine Java app. Are there any examples demonstrating how to do this?

1条回答
我只想做你的唯一
2楼-- · 2019-04-17 11:04

Try UrlRewriteFilter by tuckey. It's a Java Web Filter for any J2EE compliant web application server (and App Engine), which allows you to rewrite URLs before they get to your code.

Usage:

  • Move the urlrewrite.xml to the /war/WEB-INF directory.
  • Move the urlrewrite-3.2*.jar to the /war/WEB-INF/lib directory.
  • Add this to your /war/WEB-INF/web.xml:
  • <filter>
        <filter-name>UrlRewriteFilter</filter-name>
        <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>  
    </filter>
    <filter-mapping>
        <filter-name>UrlRewriteFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    

  • Add your configuration of your search engine friendly URLs to /war/WEB-INF/urlrewrite.xml
  • Redeploy your Google App.
  • 查看更多
    登录 后发表回答