[eluser]Pascal Kriete[/eluser]
I can't think of anything very nice, but I can think of a hack.
Duplicate the system/codeigniter/codeigniter.php and call it anything you want (codeigniter2 for all I care). Put it in the same folder.
In that file, right after:
Code:
$CFG =& load_class('Config');
$URI =& load_class('URI');
$RTR =& load_class('Router');
$OUT =& load_class('Output');
Force the one allowed path by doing:
Code:
$RTR->set_directory('directory_of_the_controller'); //make it blank if you're not using folders
$RTR->set_class('class_name'); // What your first uri segment would normally be
$RTR->set_method('method_name'); // What your second segment would be
Then, on the public side you create another index.php file identical to the regular one. Change the paths to the system and application folders to point to your protected directory.
At the bottom of the file change the require_once to point at your new codeigniter2.php file. Now your ajax call can call that new index.php .
It's a hack, but it should work. Remember that anything your js has access to, anyone will have access to.