RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ ./index.php?route=$1 [QSA]
http://ru.site.ru/m/page.php?id=100
string(10) "m/page.php"
# 301 --- http://www.test.com/faq.html?faq=13&layout=bob => http://www.test2.com/faqs.html?test=1
RewriteCond %{HTTP_HOST} ^www\.test\.com$
RewriteCond %{QUERY_STRING} (^|&)faq=13($|&)
RewriteCond %{QUERY_STRING} (^|&)layout=bob($|&)
RewriteRule ^faq\.html$ http://www.test2.com/faqs.html\?test=1 [L,R=301]