CodeIgniter Forums
404 how make a rote - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: General Help (
+--- Thread: 404 how make a rote (/thread-67005.html)

404 how make a rote - imediasun - 01-01-2017

I send ajax to server
          type: 'POST',
          url: '/functions_ajax/check_all_Ukraine',

There is a server side
class Functions_ajax extends CI_Controller {

public function __construct()
    parent:: __construct();
    $firephp = FirePHP::getInstance(true);
    $firephp -> fb("hello world! i'm warning you!",FirePHP::WARN);
    public function check_all_Ukraine(){
        echo json_encode($data);
        echo json_encode(NULL);


And this is A route
$route['functions_ajax/check_all_Ukraine'] = 'functions_ajax/check_all_Ukraine';

But I still have 404 error

RE: 404 how make a rote - Wouter60 - 01-01-2017

Use this for the url:
PHP Code:
url'<?php echo site_url();?>functions_ajax/check_all_Ukraine'

RE: 404 how make a rote - XtreemDeveloper - 01-16-2018

Firstly define base_url in header.

<script type="text/javascript">
      var site_url = '<?php echo site_url(); ?>';
      var base_url = site_url;
      var siteurl = site_url;

after that you can use url something like that where you want in whole project files.
          type: 'POST',
          url: siteurl+'functions_ajax/check_all_Ukraine',

RE: 404 how make a rote - InsiteFX - 01-17-2018

@ XtreemDeveloper

Note: base_url() and site_url() are not the same thing.

base_url() =

site_url() =

RE: 404 how make a rote - badgershockeyfan - 03-28-2018

Every time I log onto this forum I find something helpful that I didn't even know I needed... thanks XtremeDeveloper and InsiteFX!