You need to redirect your http://site.com/id
URL to your .php
file as
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d # not a dir
RewriteCond %{REQUEST_FILENAME} !-f # not a file
RewriteRule ^(.*?)/?$ index.php?id=$1 [L]
The id
now becomes available as $_GET["id"]
in PHP. If you want to limit this to numbers use
RewriteRule ^(\d+)/?$ index.php?id=$1 [L]
If you want to pass /any/path/any/page.php
to your PHP file use
RewriteRule ^(.*)$ index.php?uri=$1 [L]