I'd say this probably is what you want:
RewriteEngine on
RewriteCond
RewriteRule ^/?test/ "-" [L]
RewriteRule ^/?$ /site/ [R=301]
RewriteRule ^/?contact\.php$ /site/page/contact [R=301]
It will pass through all requests to /test
, after that you can implement whatever rules you like.
And a general hint: you should always prefer to place such rules inside the http servers (virtual) host configuration instead of using dynamic configuration files (.htaccess
style files). Those files are notoriously error prone, hard to debug and they really slow down the server. They are only supported as a last option for situations where you do not have control over the host configuration (read: really cheap hosting service providers) or if you have an application that relies on writing its own rewrite rules (which is an obvious security nightmare).