Actually, the task is the following: we have a website with a site.ru/123.html page that needs to be done so that this page is processed as a subdomain 123.site.ru

Can this be done via htaccess? I registered the aliases in the vds * settings. site.ru , so that the site.ru/12345 folders work like 12345.site.ru , now you need to transfer files to the subdomain format.

Thank you in advance for your help!

1 answer 1

Try this

RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^.+\.site\.ru$ RewriteCond %{REQUEST_URI} !/ RewriteRule ^(.*).html$ /$1 [L] 

There is no server at hand to check

  • Alas, but the script does not work: ( - banimtel