title: .htaccess rules for accessing only index.php and work jQuery post method
body: <p>I am trying to figure out the rules about three conditions </p>
  
  <ol>
  <li><strong>No one can access any php files and directories except index.php</strong></li>
  <li><strong>Hide get variables from URL</strong></li>
  <li><strong>jQuery post method should work</strong></li>
  </ol>
  
  <p>Few examples of my website URL are</p>
  
  <ul>
  <li><p>example.com/?page=search
  I want it to be like <strong>example.com/search</strong></p></li>
  <li><p>example.com/?page=username&amp;profile=overview
  I want it to be like <strong>example.com/username/overview</strong></p></li>
  <li><p>example.com/?page=result&amp;pn=1
  I want it to be like <strong>example.com/result/1</strong></p></li>
  </ul>
  
  <p>And I have jQuery post request like this</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$.post('config/post-ajax.php', "zilla="+el.val()).success(function(data) {
     var data = $.parseJSON(data);
     $('.rm1').remove();
     for (var i = 0; i &lt; data.length; i++) {
       $("#thana").append("&lt;option class=\"rm1\" value="+data[i]+"&gt;"+data[i]+"&lt;/option&gt;");
     }
  
     });</code></pre>
  </div>
  </div>
  </p>