httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt ." <yamakasi....@gmail.com>
Subject [users@httpd] Subdomain Rewrite including HTTP -> HTTPS
Date Sun, 11 Jan 2015 15:33:39 GMT
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message