简体   繁体   中英

Multiple URLs for the same content in CakePHP

I Just started exploring CakePHP. From what I have observed, In CakePHP, All of the following are the same.

Is this not considered duplicate content by the search engines?

If yes, how to fix this?

They are only duplicate content if you link to them differently, thus making the different urls visible. Usually, using cake's internal routing you can only get one of those three versions. Always.

But if someone would get hold of the wrong url and does link it from somewhere it might actually be followed by google and indexed wrongly. So yes, there is a possibility.

So

  • use htaccess to prevent the / (or vica versa) and 301 redirect to the other one
  • use canonical tag in your layout to always route to the correctly routed url - not matter what the full url including /index etc might currently look like).

Details and code examples: http://www.dereuromark.de/2012/12/29/cakephp-and-seo/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM