The only complication is that there could be an unknown amount of variables after the controller and function
For example site.com/index.php/controller/function/1/1/2/4/3/3
So I guess I have to build a function to count how many variables there are in the site url and add extra "../" based on this.
Although I really feel to integrate properly with Code Igniter site_url() and base_url() should work because it's not changing the domain.
My code is very simple but I even setup a clean test of Code Igniter and CJAX and the same thing happens. So I find it strange I'm the only one who has encountered this. It seems very simple but I can't see any other posts about this. Very strange.
I will email you the clean test version I setup that has this problem this week.