RewriteCond %{HTTP_HOST} ^(.+). $ [NC] RewriteCond %{HTTP_HOST} !^ $ [NC] RewriteCond %{REQUEST_URI} !^/page.php RewriteRule ^(.*) %{HTTP_HOST}$1 RewriteRule ^(.*). /page.php?id=$1 

The rules are working, everything is ok. But there was a problem to make a subdomain:

 RewriteRule ^*)/$ /somepage.php?id=$1 [L] 

Although the rule is set, the script /page.php?id=$1 still happens

Is there any way to fix it? Just reluctant to write a crutch in the page.php file

    1 answer 1

    The last rule is written at the end? If yes, then the rule is triggered.

     RewriteRule ^(.*). /page.php?id=$1 

    Try moving higher. And for good server should deal with such matters