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 9729D200CC7 for ; Sun, 16 Jul 2017 21:33:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 953501640A2; Sun, 16 Jul 2017 19:33:16 +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 B36A91640A1 for ; Sun, 16 Jul 2017 21:33:15 +0200 (CEST) Received: (qmail 67459 invoked by uid 500); 16 Jul 2017 19:33:14 -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 67449 invoked by uid 99); 16 Jul 2017 19:33:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Jul 2017 19:33:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C8A731A068B for ; Sun, 16 Jul 2017 19:33:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id NlD3d5wi0gg8 for ; Sun, 16 Jul 2017 19:33:12 +0000 (UTC) Received: from mail-qt0-f169.google.com (mail-qt0-f169.google.com [209.85.216.169]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DCA415F522 for ; Sun, 16 Jul 2017 19:33:11 +0000 (UTC) Received: by mail-qt0-f169.google.com with SMTP id b40so93084978qtb.2 for ; Sun, 16 Jul 2017 12:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=IF92MYCS0dzxLESxdLMgRaBuL31njG9w/OwJjja1aO4=; b=O38PJetcbzSZq6SlUVgDvdExo3N7XgV2H0bN3a4LLFuaeQhw+w3pL0SbpGL4xbLOC/ 9ZDy5qV4WoYqz81m40wcWnp9bEYTmJpGKLgcbS8/OdJqwa4HemrVvi3kPbjopL9b3hEQ F76sTUybxVJZ5kB2tgRPshvu/se9cmcgqiM15qOMtha85Cd+cA4kVmBAWOZmngR+Xrbe 8IY/gyfASoSIRa9wwYAbP1+YF9ju9R9d9RrDzdadHEfxuHIq+K0w6OWNzY7fERmGWhuG QLwMsxR1vFe+9wKQPFrhqMv6RZ6VK5Zlz+2kWRnj+hZqcrh67BcN9d11RyylRd9sb0uv 7XZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=IF92MYCS0dzxLESxdLMgRaBuL31njG9w/OwJjja1aO4=; b=AXN88Xb9DHtKCiZL5YOGlPJ9izB54HlaTBV3/UbsNTiGwqgOKNaWomegA7/pJW6vZ8 y0l4AAlb0wZsE6pPGXtAo+IWe9yz27eR8hk0FVOw+/nRP9vQBrn0efK5yfW1TCRp9G3m 5kmxYNVw7cK9wBWXKZH01HhL5RvOu+tgiy01lE5Ps0vmAWIC4VViDeZpV68NFJVMVfyI bx0zqTN7Igph/4d3GR7th/RgJK85hhh9hgHoFGk28hz9spCqC+aQ2ACmYxLKJB+xNVz/ HQMUqKB59j2M2453PjxZZOeEth5/ZcFTrNcQUVOjT6qPPNaqGLH/6oxcuxF6AmWdaAYG rFhA== X-Gm-Message-State: AIVw111FBjnHzSMFipsvHe5upxUc6ra5e9/drfOTGV3LhlwJVloxwxKG FvPWOEsqBOKJA5Xi+V1EGiFIA5liKA== X-Received: by 10.200.11.65 with SMTP id m1mr24579316qti.229.1500233590533; Sun, 16 Jul 2017 12:33:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.31.197 with HTTP; Sun, 16 Jul 2017 12:32:50 -0700 (PDT) In-Reply-To: References: From: Daniel Date: Sun, 16 Jul 2017 21:32:50 +0200 Message-ID: To: "" Content-Type: text/plain; charset="UTF-8" Subject: Re: [users@httpd] virtual host double slash effect, need solution archived-at: Sun, 16 Jul 2017 19:33:16 -0000 Redirect is simpler as you can see, it redirects everything, it has a regex version called RedirectMatch. Both are provided by mod_alias. RewriteRule is for more complex things, yes it can redirect too, but as you have seen yourself, the most simple thing can bring confusion. RewriteRute is provided by mod_rewrite and should be used only when there is no simpler option for the sake of simplicity. The rule of thumb is to go for simpler configuration directives whenever possible, and a simple redirection like that in virtualhost is a task perfect for Redirect. 2017-07-16 19:14 GMT+02:00 David Mehler : > Hello, > > Thanks. I'll try the rewrite redirect. > > With regards the redirect option, the simpler way, does it do the tls > conversion unsecure to secure? What would the advantages/disadvantages > of rewrite and redirect? > > Thanks. > Dave. > > > On 7/16/17, Daniel wrote: >> And while at it why not use simple Redirect's since your config fits >> perfectly to use them: >> >> >> ServerName example.com >> Redirect / http://www.example.com/ >> >> >> simpler, gets the job done, and you don't need a cannon to smash a fly. >> >> >> 2017-07-16 17:48 GMT+02:00 Luca Toscano : >>> Hi David, >>> >>> 2017-07-15 3:11 GMT+02:00 David Mehler : >>>> >>>> Hello, >>>> >>>> I'm running Apache 2.4 on a FreeBSD 10.3 system, with several virtual >>>> hosts. My goal is to have all of them completely ssl, except for the >>>> .well-known area needed for letsencrypt. >>>> >>>> >>>> ServerName example.com >>>> RewriteEngine On >>>> RewriteRule ^/?(.*) http://www.example.com$1 [R,L] >>>> # This line also produces the double slash effect >>>> # RewriteRule ^/?(.*) http://www.example.com/$1 [R,L] >>>> >>>> >>> >>> Have you tried with RewriteRule ^(.*)$ https://www.example.com$1 [R=301,L] >>> ? >>> (note also the https, IIUC you need to force TLS). >>> >>> Hope that helps, >>> >>> Luca >>> >> >> >> >> -- >> Daniel Ferradal >> IT Specialist >> >> email dferradal at gmail.com >> linkedin es.linkedin.com/in/danielferradal >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org >> For additional commands, e-mail: users-help@httpd.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > -- Daniel Ferradal IT Specialist email dferradal at gmail.com linkedin es.linkedin.com/in/danielferradal --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org