I am trying to redirect http://[random-string].domain.com/ to http://domain.com/folder/%5Brandom-string%5D/
I currently have this:
RewriteCond %{HTTP_HOST} ^.*\.domain\.com
RewriteRule ^.*$ http://domain.com/folder/$1/ [R=301,L]
It currently points to http://domain.com/folder//. (The $1 is missing) How do I fix this?
You need to use parenthesis to grab the value matched, in your case:
assuming you also want to redirect http://[random-string].domain.com/something to http://domain.com/folder/%5Brandom-string%5D/something