简体   繁体   中英

Cakephp - default route redirection issue

My routes.php has the following line of code:

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

When I open up my website say http://example.com , it redirects me to http://example.com/users/index

I dont want this to happen, I want the user to remain on http://example.com and show the users index view. In my other cakephp websites, this works fine, but this one its not working. I am using Cake 1.2 as this is an old website.

My .htaccess file is as following:

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

Can anyone tell me where to look for the problem?

Okay, finally I figured it out. The route inside my routes.php was sending the user to users/index, not users/home, and users/index method had a redirection to users/home if logged in. My bad. Sorry!

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