Cakephp - 默认路由重定向问题

时间:2012-03-28 20:17:47

标签: php cakephp routes redirect

我的routes.php有以下代码行:

Router::connect('/', array('controller' => 'users', 'action' => 'index', 'home'));

当我打开我的网站时说http://example.com时,它会将我重定向到http://example.com/users/index

我不希望这种情况发生,我希望用户留在http://example.com并显示用户索引视图。在我的其他cakephp网站上,这个工作正常,但这个没有用。我正在使用Cake 1.2,因为这是一个旧网站。

我的.htaccess文件如下:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>

谁能告诉我在哪里寻找问题?

1 个答案:

答案 0 :(得分:1)

好的,最后我明白了。我的routes.php中的路由是将用户发送到users / index,而不是users / home,如果登录,则users / index方法重定向到users / home。我的不好。抱歉!

相关问题