title: .htaccess URL masking instead of redirecting
body: <p>I'm trying to mask URL in away like while the real URL is <strong><code>www.somedomain.com/subfolder/index.php?p=page3</code></strong> it shows <strong><code>www.somedomain.com/subfolder/page3</code></strong> , I know such questions have been asked a lot on here and I did searched a lot but most of results didn't cater what I am looking for, also I almost know nothing but the basics about htaccess tweaking.</p>
  
  <p>one result I got when i searched has the following htaccess code:</p>
  
  <blockquote>
    <p>Options +FollowSymLinks<br>
       Options +Indexes<br>
       RewriteEngine On<br>
       RewriteRule ^index.php$ %{QUERY_STRING} [C]<br>
       RewriteRule p=(.*) www.somedomain.com/subfolder/$1? [R=301,L]</p>
  </blockquote>
  
  <p>It did the trick concerning the URL re-writing but it redirects the page instead of just masking the URL and it gives a 404 error, even when I removed the R=301 it didn't work.</p>
  
  <p>Also the code above gives a 500 server error when I launch the index page of the subfolder <strong><code>www.somedomain.com/subfolder/</code></strong>.</p>
  
  <p>Finally I'd like to mention that I'm testing with a sub-directory in localhost in case it make difference because some codes I've found on the web either just don't work at all or they give 500 server error.</p>
  
  <p>Many Thanks in Advance.</p>