How to redirect URLs with trailing slash to the corresponding ones without it?

前端 未结 7 1664
遥遥无期
遥遥无期 2020-12-05 10:12

Spring MVC (3.0) considers URLs with and without trailing slashes as the same URL.

For example:

http://www.example.org/data/something = http:

7条回答
  •  猫巷女王i
    2020-12-05 11:10

    This usually works for me with URLRewriteFilter in Spring.

    
    
    
        
             Remove trailing slash for SEO purposes
             /**/
             %{context-path}/$1
        
    
    

提交回复
热议问题