title: how to change the dynamic URL to SEO friendly using .htaccess
body: <p>I want to change the dynamic URL <code>www.example.com/business-listing.php?id=7863</code> to <code>www.example.com/some-dynamic-text/7863</code>.</p>
  
  <p>Also I want to hide .php extension from all URL, for eg: the URL <code>www.example.com/list/page.php</code>  should be change to <code>www.example.com/list/page</code></p>
  
  <p>And also when an user enter the URL <code>www.example.com/list/page.php</code>, he should restricted to access that page using that URL. Permit acess only using </p>
  
  <pre><code>www.example.com/list/page
  </code></pre>
  
  <p>I have tried the following .htaccess file:</p>
  
  <pre><code>DirectoryIndex home.php
  Options +FollowSymlinks
  RewriteEngine on
  RewriteRule ^home$ home.php
  RewriteRule ^(.*)\.html$ $1.php [nc]
  RewriteRule ^([a-zA-Z0-9_,-]+)/([a-zA-Z0-9_,-]+)$ business-listing.php?id=$1
  </code></pre>
  
  <ol>
  <li>This take the first regular expression as value of id, but I want the Second.</li>
  <li>This hide the php extension of only home.php, but I want all php files.</li>
  <li>This does not  prevent the user when entering the URL with PHP extension, That is when an user enter the URL <code>www.example.com/bill/pay.php</code> the page is open, but I want to restrict it.</li>
  </ol>