help redirect

http://subdomain.example.com/page/subpage 

on

 http://www.example.com/index.php?subdomain=subdomain&page=page&subpage=subpage 

using htaccess. Some variables may not be specified (subdomain without pages, or pages / subpages without subdomain)

    1 answer 1

    Something like this:

      RewriteEngine on RewriteRule ^(.*)$ ./адрес/$1