假设如下:删除模式和301重定向到新的URL
mywebsite.com/searches/index/page:x where x is an integer.
我想删除索引/并重定向到
mywebsite.com/searches/page:x
我的web应用程序是基于CakePHP的,和我将以下行添加到了webroot目录中的.htaccess文件,但它没有得到任何结果。
RewriteRule ^(.*)/searches/index/(.*)$ searches/$1 [R=301,L]
我需要知道正确的.htaccess代码,我应该使用。
但是,我问这个问题,因为谷歌网站管理员工具告诉我,有很多软401错误。在我的应用程序的路线我省略了调用由以下行的索引页在routes.php文件:
Router::connect('/searches/index/*', array('controller' => 'error','action'=>'e404'));
Router::connect('/searches', array('controller' => 'searches', 'action' => 'index','page' => 1));
Router::connect('/searches/*', array('controller' => 'searches', 'action' => 'index'));
所以,如果有另一种解决方案,以克服CakePHP的谷歌问题,我可以理解的知道这一点。
我的蛋糕版本是1.2.11。
这是否被拒绝投票?很高兴知道答案出了什么问题,以便我可以纠正可能出现的错误,含糊之处等。 – ndm
+1投票它回答所需的问题! – Termis