Hello, I'm trying to rewrite subdomains to user folders and rewriting the "rootdomain" to some other domain:
RewriteCond %{HTTP_HOST} ^mydomain\.tld [OR] RewriteCond %{HTTP_HOST} ^www\.mydomain\.tld RewriteRule ^(.*) http://otherdomain\.tld [L] RewriteCond %{HTTP_HOST} !^www\.mydomain.tld$ RewriteCond %{HTTP_HOST} ^([^.]+)\.mydomain\.tld$ [NC] RewriteRule ^(/[^\s]+)? http://www.mydomain\.tld/%1$1 [P,L] what happens here is that my rewrite goes well from: subdomain.mydomain.tld -> http://mydomain.tld/subdomain But than it loops into ^mydomain.tld again and redirects to: http://www.otherdomain.tld/subdomain What am I doing wrong here? Rap