htaccess issue

#1
[eluser]gRoberts[/eluser]
Hey all,

I've been using CI for a number of projects and i've just started on another.

All was going well until I went to create a second controller and noticed that my second controller was being routed to my default controller.

It only seemed to work when I used index.php/controller

config:
Code:
$config['index_page'] = "";

htacces:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|assets|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

log:
Code:
DEBUG - 2009-03-29 16:55:40 --> Config Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Hooks Class Initialized
DEBUG - 2009-03-29 16:55:40 --> URI Class Initialized
DEBUG - 2009-03-29 16:55:40 --> No URI present. Default controller set.
DEBUG - 2009-03-29 16:55:40 --> Router Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Output Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Input Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Global POST and COOKIE data sanitized
DEBUG - 2009-03-29 16:55:40 --> Language Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Loader Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Helper loaded: url_helper
DEBUG - 2009-03-29 16:55:40 --> Database Driver Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Session Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Helper loaded: string_helper
DEBUG - 2009-03-29 16:55:40 --> Encrypt Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Session routines successfully run
DEBUG - 2009-03-29 16:55:40 --> Controller Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Model Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Model Class Initialized
DEBUG - 2009-03-29 16:55:40 --> Model Class Initialized
DEBUG - 2009-03-29 16:55:40 --> File loaded: /public_html/dev/system/application/views/home.php
DEBUG - 2009-03-29 16:55:40 --> Final output sent to browser
DEBUG - 2009-03-29 16:55:40 --> Total execution time: 0.0411

Can anyone think of why it'd not work?

Cheers

Gavin

#2
[eluser]Mackstar[/eluser]
Did you look in your routes file? To see if some funky routing was going on there?

Richard

#3
[eluser]gRoberts[/eluser]
Richard,

Thanks for replying.

Its a vanilla setup. The routes file only contains the default controller and scaffolding items.

Its rather strange as its exactly the same setup that i've used for the past two years when creating CI based websites.

Thanks

Gavin

#4
[eluser]Mackstar[/eluser]
Are you using a different version of CI?

#5
[eluser]Mackstar[/eluser]
Your .htaccess file seems correct, the only hickups could be in the naming of your controller files and function names within them?? But then it shouldn't have worked in your index.php/controller setup. Did you try dropping your controller file in your working app and seeing if it worked?

Hope you get it working...

#6
[eluser]gRoberts[/eluser]
I'm using the latest version.. I may try copying them onto a working server and see if that helps.

Thanks again Richard!

#7
[eluser]Mackstar[/eluser]
It could even be something to do with your local apache settings? So a working server may work...

Cheers


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.