开发者

Canonical no-www URLs with Rails 3?

开发者_C百科What do you think about this solution? The idea is to make the no-www version as the canonical one. So we simply strip out the 'www.' from the request url:

!= '<link rel="canonical" href="' + request.url.gsub(/www\./, '') + '" />'

Any problems?


Take a look at Rack Canonical Host. I think it does exactly what you are looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜