Why can't I get a second variable in .htaccess?

Hi guys are pros.
A subdomain, I receive it in PHP., here is the code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^www
RewriteCond %{HTTP_HOST} ^([^\.]+)\.([^\.]+)\.([^\.]+)$
RewriteRule ^.*$ index.php?subdomain=%1


The main page works without problems, but the problem appears when I have the query becomes this:

subdomain.site.ru/ssylka

I tried to pass it on :
RewriteRule ^.*$/([0-9a-z\.\-]+)/([0-9a-z\.\-]+)/?$ index.php?subdomain=%1&page=&2 [L]

but did not catch the Mat.part, tell me what's wrong?
March 19th 20 at 09:05
1 answer
March 19th 20 at 09:07
long tried to understand what to do but still need to add the conditions, otherwise you can interpret your task as you want.
And so:
1. Let's start with the definition of the group from RewriteCond = %1
2. Group of the RewriteRule is$1
3. don't forget screening !!! the index.php\?subdomain\=%1&page\=\&2
4. need examples of it has become and what it should be.
According to the first code you have a subdomain is passed in get, in fact it is supposed to work, which should go just a rule, it is not entirely clear.

Find more questions by tags htaccess