 <p>for start mod-rewire start from the your domain. then on localhost if you want your mod_rewrite work you should pass it to your project address, <br /> before all above thing, you should check your mode_Rewire be enable<br /> redirect:<br /> <code>http://localhost/ConnectMyProfile/ViewProfile.php?id=CMP26944</code> or <br /> <code>http://localhost/ConnectMyProfile/ViewProfile?id=CMP26944</code><br /> to <br /> <code>http://localhost/ConnectMyProfile/ViewProfile/CMP26944</code></p> <pre><code>RewriteEngine On RewriteBase /ConnectMyProfile/ # external redirect from actual URL to pretty one RewriteCond %{THE_REQUEST} /ViewProfile\.php\?id=([^\s&amp;]+) [NC] RewriteRule ^ ViewProfile/%1? [R=302,L] RewriteCond %{THE_REQUEST} /ViewProfile\?id=([^\s&amp;]+) [NC] RewriteRule ^ ViewProfile/%1? [R=302,L] # internally rewrites /ViewProfile/ABC123 to ViewProfile.php?id=ABC123 RewriteRule ^ViewProfile/([A-Z,0-9]+)$ ViewProfile.php?id=$1 [L,NC,QSA] # PHP hiding rule RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php [L] </code></pre>