AJAX calls fail when the base URL is set
Make sure you didn't already include a base URL in your ajax link. For my development site, http://localhost/project1/ajaxlink, the following will work perfectly when no base URL has been set.

$.ajax({url: 'project1/ajaxlink', ...


In case a base URL has been set, the AJAX call is equivalent to the following, which will not work.

$.ajax({url: 'project1/project1/ajaxlink', ...