Google让我知道我有重复的元标记。这是因为我在设置friendly_id
时有重复的路线/posts/2
/posts/awesome-post-about-ponys
如何让google / DMZ看不到第一个?
答案 0 :(得分:1)
我在类似情况下使用的方法是手动捕获非常好的网址并进行重定向
if request.path != post_path(@post)
redirect_to @post, status: :moved_permanently and return
end