Welcome Guest, Not a member yet? Register   Sign In
Problems In Production With Default Method
#1

[eluser]craigkoster[/eluser]
I have a CI application that's working fine in every way on my local machine. I just deployed it to a production server and everything works except when you browse to the root url with no default controller/default method. For example, going to http://www.myapp.com/login works great but when I just go to http://www.myapp.com/ I get errors in the Router.php file in the CI libraries folder (see attached).

Anyone have any ideas as to why this might be? I looked at the Router.php code and it looks like at line 201 it's referencing an element of an array that has not been populated.

I have the following in my .htaccess file:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|js|css|blog|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
AddHandler php5-script .php

...and also have the following in my routes.php in my app config:
Code:
/* route ajax */
$route['ajax/(:any)'] = "/ajax/$1";

/* route all requests to app controller */
$route['(:any)'] = "/app/$1/$2";

Again...everything works fine on my local machine - it's when I try to browse on the production server that I get the problem. Is there a PHP setting that I need to tweak?

Thanks in advance for any help.

Craig
#2

[eluser]craigkoster[/eluser]
Ah...solved my own problem by doing some more searching on this forum.

If anyone else runs into the problem - I just went into my config.php file and changed

Code:
$config['uri_protocol']    = "AUTO";

...to be ...

Code:
$config['uri_protocol']    = "PATH_INFO";

That seems to have done the trick. Not exactly sure why but we'll go with it. :-)

Craig
#3

[eluser]Jazmo[/eluser]
Hmm. I fight the similar problem, and only choice that did the trick was ORIG_PATH_INFO.

This bugs me a little bit, because before at the same server the same project has worked fine (and still works), only difference is, that new project uses CI 1.7.2

has something changed here?

[in my case it just used my default route and ignored everything else]




Theme © iAndrew 2016 - Forum software by © MyBB