title: How to hide ajax page from public access [codeigniter]
body: <p>I have one controller which I use for ajax calls, so in jQuery I have something  like:</p>
  
  <pre><code>$.ajax({ 
    type: 'POST',
    url: '&lt;?php echo base_url().'ajax/post_message'; ?&gt;',
    data: { message: msg }
  }).done(function(data) { 
      // handling callback here               
  });
  </code></pre>
  
  <p>here ajax/post_message is working ok, but it's also accessible from URL directly.</p>
  
  <p>How can I prevent this, should place ajax file somewhere else? If so, which url I can use to access it </p>