CI on host, does not work
I have Xampp installed and locally my CRUD code Igniter works.
On the host, on the subdomain is giving 404 page not found. I uploaded the entire folder to a subdomain. The subdomain, created a folder that I named as ten. Below it the structure is identical to the local structure.
I've done:
- I changed the database configuration.php
- I changed the config configuration.php changing this item:
$config['base_url'] = '/dez/';
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase dez/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
- I have already changed all the names of the Controller and model (putting the first letter in capital).
- I have already exchanged
'$config['base_url'] = '/dez/';
for'$config['base_url'] = '/';
- and
'$config['base_url'] = 'dez/';
by'$config['base_url'] = '/dez';
- inside
.htacess
I have already exchangedRewriteBase dez/
forRewriteBase
No routes.php
----> $route['default_controller'] = 'Dashboard';
Then in the dashboard :
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Dashboard extends MY_Controller{
function __construct()
{
parent::__construct();
}
function index($indice=null)
{ ......
Within MY_Controller
:
<?php
class MY_Controller extends CI_Controller {
public function __construct()
{
parent::__construct();
$logado = $this->session->userdata("logado");
if ($logado != 1)
redirect('/Login');
}
}
Then in the browser I type the subdomain name 'sie'
and it appears https://sie.dezenvolvesolucoes.com.br/dez/Login and the IC message 404 Page Not Found
I took a test and exchanged Dashboard extends MY_Controller
for CI_Controller
.
Then, the home page is "assembled", but without formatting the layout (css, js..). I check the source code of the page (without layout formatting) and see the links to the files .css
, js
..
src="<?php echo base_url();?>assets/js/jquery.min.js">
And when I click on them, page not found . I go to CPanel and look for the files .css
and js
, all exist.
The current .htacess
, is an example that I searched here in this link: https://gist.github.com/keithmorris/3023560
Nothing....
1 answers
This was the solution:
1 - no .htacess where was RewriteBase / ten I switched to RewriteBase
2 - no config.php conf config ['base_url'] = '/';