I have following code in my .htaccess file located in root of site.com:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?site\.com$
RewriteRule ^files(.*)$ http://files.site.com/$1 [L,R=301,QSA]
I want to redirect site.com/files/path?query
to files.site.com/path?query
, but for some reason it won't work. Can someone tell me why?