Subdomain Rewrite including HTTP -> HTTPS

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

 



Hi All,

I'm having some trouble at the moment with a rewrite rule which keeps
the filled in domainname in the addressbar of the browser.

I want to rewrite:

sub.foo.tld -> foo.tld/foo/sub

as sub is %1 and foo is %2 I thought this would do the trick.

RewriteCond %{HTTP_HOST} ^([^.]+)\.foo\.tld$
RewriteRule ^(/[^\s]+)? http://foo\.tld/%2/%1$1

I can so a [P] behind the rewrite rule when I want to proxy to some
other domain if needed.

What happens at the moment that when I do sub.foo.tld I'm redirected
with a 302 to:

foo.tld//sub

As I hav this in my ssl vhost and in both the non-ssl vhost:

ServerName foo.td
ServerAlias *.foo.tld

I would assume this should be working.

I'm actually not sure how to rewrite all http requests to https in this matter.

Why am I gettting a redirect (302) at the moment and what am I doing
wrong here ?

Thanks.

Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[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