CI on host, not working

Asked

Viewed 54 times

0

I have Xampp installed and locally my CRUD Code Igniter works.

No host, subdomain is giving 404 page not found. I moved the whole folder up 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 already done:

  • I changed the database.php configuration.
  • I changed the config.php setting by 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’ve changed all the names of Controller and Model (by capitalizing the first letter).
  • I already switched '$config['base_url'] = '/dez/'; for '$config['base_url'] = '/';
  • And '$config['base_url'] = 'dez/'; for '$config['base_url'] = '/dez';
  • Within the .htacess I already traded RewriteBase dez/ for RewriteBase

In the routes.php ----> $route['default_controller'] = 'Dashboard';

So 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 name of the subdomain 'sie' and appears https://sie.dezenvolvesolucoes.com.br/dez/Login and the message of the IC 404 Page Not Found

I took a test and switched Dashboard extends MY_Controller for CI_Controller. Then, it is "mounted" the home page, but without layout formatting (css, js..). I check the source code of the page (no 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’ll go to Cpanel and look for the files .css and js, all exist.

The current .htacess, is an example that I looked for here in this link: https://gist.github.com/keithmorris/3023560

Nothingness....

  • 1

    Tip for life: before comma and after opening parenthesis, (, no white space. Punctuation is not to make the text more "beautiful".

  • Remove the <IfModule mod_rewrite.c> and the </IfModule>, save htaccess, if error 500 is because your server is without this module, ai vc or active in Cpanel (if you have Cpanel) or asks for technical support activate ... If there is no error 500 then the problem really is more obscure.

  • "Sir" Anderson Carlos Woss, I don’t think the 'Sir' had the perception that I’ve been trying to solve this problem for days. I know how to use our language.As I described in the question, even with the command CTRL+K ,the code (look ,with accent in the first ó ...)was not formatted. And now, I’m going to test Guilherme Nascimento’s tip that went straight to the goal of this forum.I tried to send this message privately but I don’t know where I can do it.

  • For formatting, you can read more in https://answall.com/editing-help

  • Thanks, I’ll give a read on this HELP.

1 answer

-1

That was the solution :

1 - no . htacess where was Rewritebase /ten I switched to Rewritebase

2 - in config.php $config['base_url'] = '/';

Browser other questions tagged

You are not signed in. Login or sign up in order to post.