title: How to use .htaccess file to get the subdomain?
body: <p>I want to redirect <a href="https://aaa.subdomain.example.com/path" rel="nofollow noreferrer">https://aaa.subdomain.example.com/path</a> to <a href="https://subdomain.example.com/aaa/path" rel="nofollow noreferrer">https://subdomain.example.com/aaa/path</a> <br>
  But how to do that with apache .htaccess file?
  I tried this, however, it didn't work :(</p>
  <pre><code>RewriteCond %{HTTP_HOST} ^([a-z0-9]+)\.subdomain\.example\.com [NC]
  RewriteRule .* https://subdomain.example.com/%1/${REQUEST_URI}
  </code></pre>