Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 801A1200B85 for ; Thu, 15 Sep 2016 16:54:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7EA47160AC6; Thu, 15 Sep 2016 14:54:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 78ED9160ABA for ; Thu, 15 Sep 2016 16:54:34 +0200 (CEST) Received: (qmail 95749 invoked by uid 500); 15 Sep 2016 14:54:32 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 95739 invoked by uid 99); 15 Sep 2016 14:54:32 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2016 14:54:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 75422185EA0 for ; Thu, 15 Sep 2016 14:54:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.244 X-Spam-Level: * X-Spam-Status: No, score=1.244 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, HTML_OBFUSCATE_05_10=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URI_TRY_3LD=0.064] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id MT7DxVDFOUKU for ; Thu, 15 Sep 2016 14:54:30 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id D19CB5F59E for ; Thu, 15 Sep 2016 14:54:29 +0000 (UTC) Received: by mail-lf0-f54.google.com with SMTP id u14so40763264lfd.1 for ; Thu, 15 Sep 2016 07:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=a/oAr0n6idnlNCNLvPFSmW8kr1GOtVXkeajv7DmE13g=; b=nbCvfYRTgaBrCo2kDHpdrF3RcWuXFxLHCPY8XDBsDojhVnp74T4sjgaI3x6LwmM7pD /2V1ehO40tsbQXYgjQAuQzZlYSTkLkFyBiXA+hHovifJR/yr6i8oK1WRQSsfrN5TwDBx os+TL9II4fJWWa9QUyPGjWAd5K2tLk6y2F3ZexTknrjadz0mOpUUkcoSgrcIezl/uGUs tVEwxVvxG4sHgfMu/ZqBrBgl6il0Z1+osqWN2f2KR/+l/QYnAb5lZUc0Wv/oCjT1ovdn rOsj9CAGO0fp8RmUPo9k4tWhq07Ah0GwPZHZuZFqG7yIyBuuq3SkH6mBGLX3rnA6mfC1 Gc8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=a/oAr0n6idnlNCNLvPFSmW8kr1GOtVXkeajv7DmE13g=; b=aL6D0CVQZgBc0eP4ze1+a4BHNQaaCH00eicza5M46Sx9gBP6IUj1+ZQGM4/1PuuuYR n1dUzYHR7NHiY5aL0cO279j/1h01Tpgc718LQmhwQcIDW+Q+v+2pp4aJ66BAnPrpyIF4 7OqIY3GsK7eB6pRbhdoqSz03BKf7PgOawnPbqB1QWRn6n917ACYv1N7QZ2983etqArGK i84KXxBpR3Q/jIOJ7fLsC/Y+vVJAmFqrEv1Un4RvRjgsSnwUIiSTGO70ZVwWRTabOri7 yXPbQYJLAfEgnQ48gOBr/ypK+AwaA7mKTAMvvQrkdJijOe33rK5G36Pj2cHAlzNGiVgn d/Zw== X-Gm-Message-State: AE9vXwM9NxRacMiyMKwr1ltBHH9Glj6Zs5faxQH9c2tEeGCe8Blde6ql9kjXzkEOU2aS1nSopXM615AsDgXwvg== X-Received: by 10.28.146.211 with SMTP id u202mr1038940wmd.54.1473951268359; Thu, 15 Sep 2016 07:54:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.128.136 with HTTP; Thu, 15 Sep 2016 07:54:27 -0700 (PDT) Received: by 10.28.128.136 with HTTP; Thu, 15 Sep 2016 07:54:27 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?B?S29ucsOhZCBMxZFyaW5jemk=?= Date: Thu, 15 Sep 2016 16:54:27 +0200 Message-ID: To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=001a114423a2c4550a053c8d05bc Subject: Re: [users@httpd] Apache Rewrite - Redirect Wildcard Subdomain archived-at: Thu, 15 Sep 2016 14:54:35 -0000 --001a114423a2c4550a053c8d05bc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I think you found the problem. Likely the wildcard DNS is not set. I wrote to our system admin to set the DNS. Thanks for the idea! Webmaster33 2016.09.15. 16:23 ezt =C3=ADrta ("Rodrigo Cunha" ): > about Situation 3 > as you set up your dns? > the subdomains are directed to the correct server? > in http://aaa.subdomain.oldsite.com/foo/bar.php dsn is different from > http://subdomain.oldsite.com/foo/bar.php are different subdomains. > > 2016-09-15 10:33 GMT-03:00 Webmaster33 : > >> Using Apache 2.2.22. >> >> I have the following SSL certificates: >> >> >> Common Name =3D subdomain.oldsite.com >> Subject Alternative Names =3D subdomain.oldsite.com, *. >> subdomain.oldsite.com >> >> Common Name =3D subdomain.newsite.com >> Subject Alternative Names =3D subdomain.newsite.com, *. >> subdomain.newsite.com >> >> >> I would like the following rewrite actions: >> 1) Redirect all unsecure requests to secure site, also requests from >> old sites to new site >> >> http://subdomain.oldsite.com =3D> https://subdomain.newsite.com >> https://subdomain.oldsite.com =3D> https://subdomain.newsite.com >> >> 2) Keep request %{REQUEST_URI} between redirects. Also use wildcard >> subdomains, and redirect them to secure new site, keeping wildcard >> subdomain. >> >> http://subdomain.oldsite.com/foo/bar.php =3D> >> https://subdomain.newsite.com/foo/bar.php >> https://subdomain.oldsite.com/foo/bar.php =3D> >> https://subdomain.newsite.com/foo/bar.php >> >> 3) wilcard subdomains, which are NOT ALLOWED should redirected to >> secure subdomain.newsite.com (aaa, bbb are not allowed) >> >> http://aaa.subdomain.oldsite.com/foo/bar.php =3D> >> https://subdomain.newsite.com/foo/bar.php >> https://aaa.subdomain.oldsite.com/foo/bar.php =3D> >> https://subdomain.newsite.com/foo/bar.php >> http://bbb.subdomain.oldsite.com/foo/bar.php =3D> >> https://subdomain.newsite.com/foo/bar.php >> https://bbb.subdomain.oldsite.com/foo/bar.php =3D> >> https://subdomain.newsite.com/foo/bar.php >> >> No one is allowed, except those subdomains, which are listed in 4. point= . >> >> 4) wilcard subdomains, which are ALLOWED should redirected to secure >> mysite.subdomain.newsite.com Allowed site: >> >> http://mysite.subdomain.oldsite.com/foo/bar.php =3D> >> https://mysite.subdomain.newsite.com/foo/bar.php >> https://mysite.subdomain.oldsite.com/foo/bar.php =3D> >> https://mysite.subdomain.newsite.com/foo/bar.php >> >> My problem is, that >> >> http://aaa.subdomain.oldsite.com/foo/bar.php >> >> shows Server not found error. >> >> All the 1), 2) kind of situations are redirecting fine. I have >> problems getting result for 3), 4). >> >> >> I have the following config files in /etc/apache2/sites-available/ >> >> default >> default-ssl >> subdomain.oldsite.com >> subdomain.oldsite.com_ssl >> subdomain.newsite.com >> subdomain.newsite.com_ssl >> mysite.subdomain.newsite.com_ssl >> >> >> >> Using VirtualHost config files like this (this is from >> subdomain.oldsite.com): >> >> >> ServerName oldsite.com >> ServerAlias *.oldsite.com >> >> RewriteEngine On >> >> RewriteCond %{HTTP_HOST} ^(.+\.)?oldsite.com$ [NC] >> RewriteRule ^/(.*) https://newsite.com/$1 [R=3D301,L] >> >> >> >> How can I reach to get good redirection results for 3), 4) ? >> >> >> Thanks in advance! >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org >> For additional commands, e-mail: users-help@httpd.apache.org >> >> > > > -- > Atenciosamente, > Rodrigo da Silva Cunha > > --001a114423a2c4550a053c8d05bc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I think you found the problem.
Likely the wildcard DNS is not set.

I wrote to our system admin to set the DNS.

Thanks for the idea!
Webmaster33


2016.09.15. 16:23= ezt =C3=ADrta ("Rodrigo Cunha" <rodrigo.root.rj@gmail.com>):
ab= out Situation 3
as
you set up your dns<= span>?

the subdomains are = directed to the correct server?
<= span>in http://aaa.subdomain.oldsite.com/foo/bar.php<= /span> dsn is different from http://subdomain.o= ldsite.com/foo/bar.php are different sub= domains.

2016-09-15 10:33 GMT-03:00 Webmaster33 <webmas= ter33@gmail.com>:
Using Ap= ache 2.2.22.

I have the following SSL certificates:


=C2=A0 =C2=A0 Common Name =3D subdomain.oldsite.com
=C2=A0 =C2=A0 Subject Alternative Names =3D subdomain.oldsite.com, *= .subdomain.oldsite.com

=C2=A0 =C2=A0 Common Name =3D subdomain.newsite.com
=C2=A0 =C2=A0 Subject Alternative Names =3D subdomain.newsite.com, *= .subdomain.newsite.com


I would like the following rewrite actions:
1) Redirect all unsecure requests to secure site, also requests from
old sites to new site

=C2=A0 =C2=A0 http://subdomain.oldsite.com=C2=A0 =C2=A0=3D>=C2=A0= https://subdomain.newsite.com
=C2=A0 =C2=A0 https://subdomain.oldsite.com=C2=A0 =C2=A0=3D>=C2= =A0 https://subdomain.newsite.com

2) Keep request %{REQUEST_URI} between redirects. Also use wildcard
subdomains, and redirect them to secure new site, keeping wildcard
subdomain.

=C2=A0 =C2=A0 http://subdomain.oldsite.com/foo/bar.php<= /a>=C2=A0 =C2=A0=3D>
https://subdomain.newsite.com/foo/bar.php
=C2=A0 =C2=A0 https://subdomain.oldsite.com/foo/bar.ph= p=C2=A0 =C2=A0=3D>
https://subdomain.newsite.com/foo/bar.php

3) wilcard subdomains, which are NOT ALLOWED should redirected to
secure subdomain.newsite.com (aaa, bbb are not allowed)

=C2=A0 =C2=A0 http://aaa.subdomain.oldsite.com/foo= /bar.php=C2=A0 =C2=A0=3D>
https://subdomain.newsite.com/foo/bar.php
=C2=A0 =C2=A0 https://aaa.subdomain.oldsite.com/fo= o/bar.php=C2=A0 =C2=A0=3D>
https://subdomain.newsite.com/foo/bar.php
=C2=A0 =C2=A0 http://bbb.subdomain.oldsite.com/foo= /bar.php=C2=A0 =C2=A0=3D>
https://subdomain.newsite.com/foo/bar.php
=C2=A0 =C2=A0 https://bbb.subdomain.oldsite.com/fo= o/bar.php=C2=A0 =C2=A0=3D>
https://subdomain.newsite.com/foo/bar.php

No one is allowed, except those subdomains, which are listed in 4. point.
4) wilcard subdomains, which are ALLOWED should redirected to secure
mysite.subdomain.newsite.com Allowed site:

=C2=A0 =C2=A0 http://mysite.subdomain.oldsite.co= m/foo/bar.php=C2=A0 =C2=A0=3D>
https://mysite.subdomain.newsite.com/foo/bar.ph= p
=C2=A0 =C2=A0 https://mysite.subdomain.oldsite.= com/foo/bar.php=C2=A0 =C2=A0=3D>
https://mysite.subdomain.newsite.com/foo/bar.ph= p

My problem is, that

=C2=A0 =C2=A0 http://aaa.subdomain.oldsite.com/foo= /bar.php

shows Server not found error.

All the 1), 2) kind of situations are redirecting fine. I have
problems getting result for 3), 4).


I have the following config files in /etc/apache2/sites-available/

=C2=A0 =C2=A0 default
=C2=A0 =C2=A0 default-ssl
=C2=A0 =C2=A0 subdomain.oldsite.com
=C2=A0 =C2=A0 subdomain.oldsite.com_ssl
=C2=A0 =C2=A0 subdomain.newsite.com
=C2=A0 =C2=A0 subdomain.newsite.com_ssl
=C2=A0 =C2=A0 mysite.subdomain.newsite.com_ssl



Using VirtualHost config files like this (this is from subdomain.oldsite= .com):

=C2=A0 =C2=A0 <VirtualHost *:80>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ServerName oldsite.com
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ServerAlias *.oldsite.com

=C2=A0 =C2=A0 =C2=A0 =C2=A0 RewriteEngine On

=C2=A0 =C2=A0 RewriteCond %{HTTP_HOST} ^(.+\.)?oldsite.com$ [NC]
=C2=A0 =C2=A0 RewriteRule ^/(.*) https://newsite.com/$1 [R=3D301,L]
=C2=A0 =C2=A0 </VirtualHost>


How can I reach to get good redirection results for 3), 4) ?


Thanks in advance!

-----------------------------------------------------------------= ----
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




--
Atenciosamente,
= Rodrigo da Silva Cunha

--001a114423a2c4550a053c8d05bc--