auto_prepend_file , auto_append_file

:: .htaccess

php_value auto_prepend_file "/[doc_root]/[path]/head.php"
php_value auto_append_file "/[doc_root]/[path]/foot.php"

::test.php

::head.php

::foot.php

::result
HEAD HERE
It works
FOOT HERE

rewriterule

— .htaccess
RewriteEngine On

RewriteCond %{HTTP_HOST} ^(.*)\.html\.local$
RewriteRule ^$ /index.php?id=%1 [L]
# (.*) == variable %1
# [L] flag last, apply condition to here

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://html.local/index.php?id=$1 [L]
# server variable == $1 $2 …

— index.php

If url is
http://admin.html.local
::result
admin

If url is
http://tester.html.local
::result
tester

If url is
http://admin.html.local/aaa
::result
aaa