CodeIgniter Forums
Why do website not show after uploaded to host? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Why do website not show after uploaded to host? (/thread-62136.html)



Why do website not show after uploaded to host? - myfaith237 - 06-12-2015

I has used FileZilla upload all source code of website to host, has imported database successfully, and deleted file default.php in folder public_html , but when I enter the website address, it only shows file welcome.php like this:
Welcome to CodeIgniter!
The page you are looking at is being generated dynamically by CodeIgniter.
If you would like to edit this page you'll find it located at:
application/views/welcome_message.php
The corresponding controller for this page is found at:
application/controllers/welcome.php
If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.

After I set ../application/config/routes.php like this :
PHP Code:
$route['default_controller'] = "cHome"
cHome is controller of home page of website, it shows error like this :
404 Page Not Found

The page you requested was not found.

I've replaced the other controllers on it but still have the same result, try site_url() or base_url() function, it shows error like this function is not defined. Source I uploaded not to modify configuration anything. I don't understand why. Everybody help me. Thanks!


RE: Why do website not show after uploaded to host? - Blair2004 - 06-13-2015

Your should check out your configurations (are your using 'index.php' in your url) I think you should write chome instead of cHome, some server are case sensitive.

Is your website working on local server ?


RE: Why do website not show after uploaded to host? - wolfgang1983 - 06-13-2015

(06-12-2015, 08:10 AM)myfaith237 Wrote: I has used FileZilla upload all source code of website to host, has imported database successfully, and deleted file default.php in folder public_html , but when I enter the website address, it only shows file welcome.php like this:
Welcome to CodeIgniter!
The page you are looking at is being generated dynamically by CodeIgniter.
If you would like to edit this page you'll find it located at:
application/views/welcome_message.php
The corresponding controller for this page is found at:
application/controllers/welcome.php
If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.  

After I set ../application/config/routes.php like this :



PHP Code:
$route['default_controller'] = "cHome"  
cHome is controller of home page of website, it shows error like this :
404 Page Not Found

The page you requested was not found.

I've replaced the other controllers on it but still have the same result, try site_url() or base_url() function, it shows error like this function is not defined. Source I uploaded not to modify configuration anything. I don't understand why. Everybody help me. Thanks!


I would change the controller to some thing like Chome.php

PHP Code:
<?php

class Chome extends CI_Controller {
 
  public function index() {
 
  }



Then routes $route['default_controller'] = "chome";

or

$route['default_controller'] = "chome/index";


RE: Why do website not show after uploaded to host? - myfaith237 - 06-14-2015

(06-13-2015, 08:13 AM)Blair2004 Wrote: Your should check out your configurations (are your using 'index.php' in your url) I think you should write chome  instead  of cHome, some server are case sensitive.

Is your website working on local server ?

Here is my configurations in file config.php :
PHP Code:
$config['base_url']    = 'http://nhacchonloc.zz.mu';
$config['index_page'] = '';
$config['uri_protocol']    = 'AUTO';
... 
I'm using free host of Hostinger,domain is 'http://nhacchonloc.zz.mu'. I changed 'cHome' to 'chome' as the same that you said, or changed
PHP Code:
$config['index_page'] = ''
to 
PHP Code:
$config['index_page'] = 'index.php'


but the result still was not changed anything. 
When I entered the address URL is 'nhacchonloc.zz.mu/index.php/cHome', home page was showed, but when I redirected to the other page, any the page,  it showed "error_404?"


RE: Why do website not show after uploaded to host? - myfaith237 - 06-14-2015

(06-13-2015, 09:11 PM)riwakawd Wrote:
(06-12-2015, 08:10 AM)myfaith237 Wrote: I has used FileZilla upload all source code of website to host, has imported database successfully, and deleted file default.php in folder public_html , but when I enter the website address, it only shows file welcome.php like this:
Welcome to CodeIgniter!
The page you are looking at is being generated dynamically by CodeIgniter.
If you would like to edit this page you'll find it located at:
application/views/welcome_message.php
The corresponding controller for this page is found at:
application/controllers/welcome.php
If you are exploring CodeIgniter for the very first time, you should start by reading the User Guide.  

After I set ../application/config/routes.php like this :




PHP Code:
$route['default_controller'] = "cHome"  
cHome is controller of home page of website, it shows error like this :
404 Page Not Found

The page you requested was not found.

I've replaced the other controllers on it but still have the same result, try site_url() or base_url() function, it shows error like this function is not defined. Source I uploaded not to modify configuration anything. I don't understand why. Everybody help me. Thanks!


I would change the controller to some thing like Chome.php


PHP Code:
<?php

class Chome extends CI_Controller {
 
  public function index() {
 
  }



Then routes $route['default_controller'] = "chome";

or

$route['default_controller'] = "chome/index";

My controller cHome.php like this :
PHP Code:
class CHome extends CI_Controller{
 
   public function __construct() {
 
       parent::__construct();
 
   }
 
    
    public 
function index(){
    ...
    }

Regardless I configured file routes.php like this :
PHP Code:
$route['default_controller'] = "cHome"
or 
PHP Code:
$route['default_controller'] = "chome"

the result was still not changed.


RE: Why do website not show after uploaded to host? - mwhitney - 06-15-2015

Controller file/class names are supposed to be ucfirst, i.e. Chome.php, not cHome.php or chome.php.

You might be able to get away with CHome.php, but I wouldn't depend on it.

In most cases, the names in the configuration files can be all lowercase.