Hi,
I've just started learning cakephp and have gotten the Blog example working except for the routing, I'm still not quite sure how it works after reading many, many documents on routing (including the ones in the official cookbook).
My problem is with the '/' root routing, I want it to go to the index() function of the PostsController so I use:
Router::connect ('/', array('controller'=>'posts', 'action'=>'index'));
But this doesn't work if I go to the url: localhost/
This is probably (most definetely) because I don't know where to put the cake_1_3 folder/installation, currently my directory tree for localhost (in htdocs) looks as follows:
-htdocs>posts>cake_1_3
This means that when I navigate to: localhost/ I get nothing and when I navigate to: localhost/posts/ I get nothing, just the directory listing for the folder "posts" which shows I have the directory "cake_1_3".
It is only when I go to the url: localhost/posts/cake_1_3/posts/ does the routing work, as in it sees the second "posts" and so runs the "index" function of "PostsController".
Obviously this isn't what I want, I want to be able to go to: localhost/posts/ and it use the index function of the PostsController.
Update: I actually tried taking all the cakephp stuff out of "cake_1_3" and just into "posts" but then I have to go to: localhost/posts/posts/ for it to use the index() function of PostsController.
Is there any way I can just navigate to localhost/posts/ and I'll get the index() function of the PostsController running?
I know this is probably a very simple problem and I'm just missing something because I'm so tired (well that's my excuse anyway), but I've been searching around for about 3 hours now and wouldn't mind a helping hand.
Thanks for your time,
InfinitiFizz
P.S. I've just realised I can dump all the cakephp installation files/folders into the root (htdocs) and then localhost/posts/ will work but I've got loads of different test websites in their own folders in htdocs/ and so I'd rather have this posts test in its own folder too, not have all the cakephp folders mixed up with all the other websites' folders.