happyhardik
happyhardik

Reputation: 25527

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?

Upvotes: 1

Views: 1132

Answers (1)

happyhardik
happyhardik

Reputation: 25527

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!

Upvotes: 1

Related Questions