How to redirect from folder to subdomain?

How to redirect from the address

site.ru/image/каие-то_символы
on
каие-то_символы.site.ru
July 8th 19 at 16:37
2 answers
July 8th 19 at 16:39
Solution
RewriteCond %{HTTP_HOST} ^(?:www\.)?site\.ru$
RewriteRule ^image/(.+)$ http://$1.%{HTTP_HOST}/ [R=301,L]
July 8th 19 at 16:41
RewriteCond %{HTTP_HOST} ^(www\.|)site\.ru$ [NC]
# check that there are no cycles, site no 3 levels, or only with BBB
RewriteCond %{REQUEST_URI} ^image/(+*)$ 
# all that is in the folder image not less than 1 character
RewriteRule ^(.*)$ http://%1.%{HTTP_HOST}/$ [R=301,L]
#%1 - everything in brackets vyshee in led ^image/(+*)$
500-I error - timmothy_Hills commented on July 8th 19 at 16:44
image/(.*)$ correct so , look in the logs what line is causing the jamb. - Lavern_Schuppe commented on July 8th 19 at 16:47
: A joint in this string I was also changed to "image/(.*)$", but it doesn't work, no error and not working. - timmothy_Hills commented on July 8th 19 at 16:50
: try to add in this place certain url, and see if it works with it a redirect, if Yes then we will think with the mind all right, it's hard to say what's not working, though perhaps it takes the variable from the first Konda, then try to substitute in the last rule %together 2% 1 - Lavern_Schuppe commented on July 8th 19 at 16:53

Find more questions by tags htaccess