Hello I want to rewrite sub.domain.com to domain.com/sub.
But also sub2.domain.com needs to be rewritten to domain.com/sub2 and sub3 etc...
The url is not allowed to change so a redirect is not an option.
My current code is an endless redirect:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com [NC]
RewriteRule ^(.*?)/?$ http://sub.domain.com/$1 [L]
How can I change the .htaccess to get this fixed.