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-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to