Rewrite Subdomain to Userfolder without Loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux