Serving sitemap.xml and robots.txt with Spring MVC

后端 未结 2 1781
鱼传尺愫
鱼传尺愫 2021-01-30 14:42

What is the best way to server sitemap.xml and robots.txt with Spring MVC? I want server these files through Controller in cl

2条回答
  •  忘掉有多难
    2021-01-30 15:25

    Add this line to your dispatcher servlet xml file:

     
    

    Put the robots.txt at WEB-INF/robots.txt. The file will be accessible by yoursite.com/robots.txt

提交回复
热议问题