0

I have a website that's written using CakePHP. I've added some rewrite rules in the .htacces file to change the default urls to different ones (instead of /controller1/action1/parameter I have /some-string-about-controller-and-action/parameter, for example).

The problem is that now both the normal url and the nice one are available, and google seems to be indexing both, which is a problem. I'd like to only keep the nice one, which is the proper way to handle this so that it affects the google results as little as possible?

4

1 回答 1

0

我不知道你为什么不想使用 cakes 自己的路由(如果你在做你想做的事时遇到困难,你可以使用自定义路由类来完成你想要的),然后确保你重定向所有相关的 URL您的 .htaccess 文件使用 MOVED PERMANENTLY 重定向到所需的 URL。

这样,谷歌将索引目标网址而不是不受欢迎的网址。您对此感到冒犯是对的,双重索引是损害您的 SEO 排名的好方法。

于 2012-06-19T19:06:14.950 回答