"Page not found" after uploading the site to production server |
[eluser]jstuardo[/eluser]
Hello... I have this problem, now when uploading the developed site to production. My development server has IIS 6.0 and CodeIgniter works correctly there. I developed a site whose default controller is "frontend/evento". That way, I can access it using either: http://corridacoanil/index.php/frontend/evento or http://corridacoanil/ The problem I have now is when I uploaded the site to the production server, which has Apache Web Server under Linux O.S., the site doesn't work (it shows a Page not Found error) If I use: http://desacoanil.hosting.cl The home page loads correctly, but when I use http://desacoanil.hosting.cl/index.php/frontend/evento it does not. the routes.php file has $route['default_controller'] = "frontend/evento"; So, why I cannot access the page using the whole URL? The same problem happens with all other controllers. Not even Welcome page works (http://desacoanil.hosting.cl/index.php/welcome) The log file shows the following: Code: DEBUG - 2009-06-14 18:54:56 --> Config Class Initialized of course index.php file is present. If I use http://desacoanil.hosting.cl/index.php the default controller is loaded. Any help will be greatly appreciated Thanks Jaime
[eluser]gtech[/eluser]
Hi Jaime, have you tried the steps in the [url="http://ellislab.com/codeigniter/user-guide/installation/troubleshooting.html"]trouble shooting guide[/url]? i.e: step 1)Try alternate URI_PROTOCOL settings in the config step 2)set $config['index_page'] = "index.php?" hope this helps.
[eluser]jstuardo[/eluser]
Hello.. the problem is not as easy to resolve. By following the PHP code I found where the problem is: index.php file loads CodeIgniter.php file. That file loads some classes. Only ONE of those classes cannot be loaded. It is Router.php. Digging inside it, I found that the problem is in function _validate_request($segments). This is the whole code of it: Code: function _validate_request($segments) $segments parameter is an array of 3 element, whose first element is index.php, so, when APPPATH.'controllers/'.$segments[0] is used, this is the file that is trying to load: Code: system/application/controllers/index.php Of course, it will be unable to be loaded. So I have found the problem, but I cannot realize about the solution because I cannot imagine why is happening this. Why $segments contains index.php too? I didn't see where $this->uri->segments was initialized incorrectly. Why does that work in IIS? In IIS, first element of $segments[0] is Code: system/application/controllers/backoffice which is correct. Any further help will be greatly appreciated. Thanks Jaime
[eluser]jstuardo[/eluser]
I have found the origin of the problem: Somewhere in the code, URI was assigned the value of $_SERVER['PATH_INFO']. In my hosting account the value returned was /index.php/backoffice/evento, but in my IIS server it was: /backoffice/evento. Why is that? the URL passed to the browser in the hosting account was: http://desacoanil.hosting.cl/index.php/b...ice/evento and in my local server was: http://corridacoanil/index.php/backoffice/evento I tried with rewrite conditions but with no success. any help? thanks Jaime
[eluser]jstuardo[/eluser]
Ufff... that is becoming an unsolved mystery, but finally the solution was to change AUTO uri_protocol to REQUEST_URI in config.php file. In order to change that, I had to find where the problem was so that I don't use blind solutions Thanks Jaime
[eluser]Colin Williams[/eluser]
Quote:Hi Jaime, Quote:Hello.. the problem is not as easy to resolve. Quote:finally the solution was to change AUTO uri_protocol to REQUEST_URI in config.php file :gulp:
|
Welcome Guest, Not a member yet? Register Sign In |