Welcome Guest, Not a member yet? Register   Sign In
How to resolve error 404
#1

Hi everybody,

I'have 2  problem with CI.
I have transfered 2 website made with CI from a server to my server. I have config database.php and config.php .

1: My website is on a sub domaine : http://abtours.b-communication.be .

When i clic to see the website (I havec index.html before my site content) , I get 404 erreur:

404 Page Not Found
The page you requested was not found.
Website :


2: I did the same, but this time i get sql error:
http://khs.b-communication.be


Can anyone help me?
Reply
#2

Use your web browsers development tools to see what is causing the 404 error.

Most use use F12 key to activate.

I have a sub-domain on mine and I just call it by its name no , period.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

You have not provided enough information to help you. Perhaps show your config/config.php and/or config/database.php

You must have config/routes.php as well, since the two links on your homepage lead to xxx/fr and xxx/nl

The second URL you mention in your post leads to a bunch of code shown, as if you are missing a <?php delimiter
Reply
#4

(This post was last modified: 12-08-2015, 05:57 AM by Elfrancki.)

Database.php:
PHP Code:
$active_group 'default';
$active_record TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'abtours_';
$db['default']['password'] = '********';
$db['default']['database'] = 'abtours_';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE


Config.php:

PHP Code:
$config['base_url']    = "http://abtours.b-communication.be/";

$config['index_page'] = '';

$config['uri_protocol']    = 'QUERY_STRING';

$config['url_suffix'] = '';

$config['language']    = 'fr';

$config['charset'] = 'UTF-8';


$config['enable_hooks'] = FALSE;


$config['subclass_prefix'] = 'MY_';

$config['permitted_uri_chars'] = 'a-z 0-9~%.=:_\-';
$config['allow_get_array']        = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger']    = 'c';
$config['function_trigger']        = 'm';
$config['directory_trigger']    = 'd';


$config['log_threshold'] = 0;

$config['log_path'] = '';


$config['log_date_format'] = 'Y-m-d H:i:s';

$config['cache_path'] = '';

$config['encryption_key'] = 'ser1alkr3ative.cms';


$config['sess_cookie_name']        = 'ci_session';
$config['sess_expiration']        = 7200;
$config['sess_expire_on_close']    = FALSE;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']        = 'sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']    = 300;
$cookie_prefix str_replace('.'''$_SERVER['HTTP_HOST']);

$cookie_domain $_SERVER['HTTP_HOST'];
$cookie_domain explode('.'$cookie_domain);
$cookie_domain array_reverse($cookie_domain);
$cookie_domain ".".$cookie_domain[1].".".$cookie_domain[0];

$config['cookie_prefix']    = $cookie_prefix;
$config['cookie_domain']    = $cookie_domain;
$config['cookie_path']        = "/";
$config['cookie_secure']    = FALSE;

$config['global_xss_filtering'] = FALSE;
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;


$config['compress_output'] = FALSE;

$config['time_reference'] = 'local';

$config['rewrite_short_tags'] = FALSE;

$config['proxy_ips'] = ''


Routes.php
PHP Code:
$route['default_controller'] = "front";
$route['404_override'] = 'front'
Reply
#5

Apache?
mod_rewrite active?
Is there an original .htaccess file and have you copied it?
Reply
#6

(12-08-2015, 06:11 AM)ivantcholakov Wrote: Apache?
mod_rewrite active?
Is there an original .htaccess file and have you copied it?

 Yes, apache2 .
I copied all files from the old server (where it worked), there is /htacess:
PHP Code:
<IfModule mod_rewrite.c>
 
   RewriteEngine On
    RewriteBase 
/abtours/
    
RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
%{REQUEST_FILENAME} !-d
    RewriteRule 
^(.*)$ /index.php?$[L]
    
 
</
IfModule>
 
<
IfModule !mod_rewrite.c>
 
 
   # Without mod_rewrite, route 404's to the front controller
 
   ErrorDocument 404 /index.php
 
</IfModule
Reply
#7

I jsut saw that when I go to admin I got this error:


load->view($this->view_data['canvas'])?>


Does it change something ?
Reply
#8

Your site is on a sub-domain, not on a sub-directory as far as I can understand.

Code:
RewriteBase /abtours/

Are sure about this line within your .htaccess file? What would happen if you just comment this line?
Reply
#9

nothing happen . Now I have error 500 on it ...
Reply
#10

I can not see something wrong in the configuration data then. Perhaps other information is needed, but it is hard to guess what. Call somebody to have a look at the all the code and make it running.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB