'Moving codeigniter project from localhost to cpanel
I am trying to run my codeigniter website on the server.But I don't have a clue that what settings should I perform.
I find the following link to move the files and do the specified settings but still its not showing me the home page of my website.
Here's what I've done till now.
I moved the codeigniter website's application and system folder on the root directory while my .htaccess file along with my assets and index.php is inside public_html.
Here's my directory structure.
-/home/mysite
-public_html
-index.php <-- the path for system is set to '/home/mysite/system' and for application folder is '/home/mysite/application'
-.htaccess
-system
-application
I've performed the following settings as mentioned in the link.
$config['index_page'] = "";
$config['base_url'] = "http://myurl.com/";
$config['server_root'] = $_SERVER['DOCUMENT_ROOT'];
$config['uri_protocol'] = 'AUTO';
$route['default_controller'] = "home_controller";
Here's my .htaccess file.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Now I don't know why my home page is still not appearing when I enter the url to my site.
Solution 1:[1]
upload your application folder, system folder, assets folder, index.php, .HTACCESS inside your public_html folder
Solution 2:[2]
You need to do few steps:
- update 'application/config/config.php' for
base_url - update 'htaccess' file for
RewriteBase(if needed) - update file permission (if needed)
- update 'aplication/config/database.php' for
databasesettings - if still you face issue, then you need to debug like:
- print something in index controller and walk through along the function sequence called and then views.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | slav |
| Solution 2 | Naveed Ramzan |
