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 42ED3200D3B for ; Fri, 10 Nov 2017 10:13:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 417A8160BF2; Fri, 10 Nov 2017 09:13:13 +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 5FFD9160BEE for ; Fri, 10 Nov 2017 10:13:12 +0100 (CET) Received: (qmail 91636 invoked by uid 500); 10 Nov 2017 09:13:05 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 91625 invoked by uid 99); 10 Nov 2017 09:13:05 -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; Fri, 10 Nov 2017 09:13:05 +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 E3E271A0CE4 for ; Fri, 10 Nov 2017 09:13:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ypcvQH577edk for ; Fri, 10 Nov 2017 09:13:02 +0000 (UTC) Received: from mail-qt0-f169.google.com (mail-qt0-f169.google.com [209.85.216.169]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 1D7DD5FD72 for ; Fri, 10 Nov 2017 09:13:02 +0000 (UTC) Received: by mail-qt0-f169.google.com with SMTP id 31so11005893qtz.9 for ; Fri, 10 Nov 2017 01:13:02 -0800 (PST) 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=vruMY5XTayYZ1EMCw8WDmLK/hTx7WYkx4mw2miNyia8=; b=dawubMh4OcTtMsvyzgYbv0LMrjaTZu+fS1N6aSpcwtjzEKpCAEb8SaPXNHlL3vGAkm T4pp8rzR0WH3JgmflkOzoe08B8IGJ92ktLhFM2ohG97VeE8f2O03AEI1LO37tipAINQt 7hNwE7kR/X1bsjnNZiU1Hrsu5dsmmmjJbWWvaIhMDXc0nP2ZloUKBjQkGjP8UqAWkCes cyCmuxe4I8E+wDvQQx/HozuZ8x0t4UI2OPoD9hkadQCCFBxTfbTABBn6cioaY/xl/8gj KYKQR5MUOzAN1mMheb75BptO32+og/Ub72JC1tStfFOOHENetXVAX88TIPn06Cpbx57R shzw== 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=vruMY5XTayYZ1EMCw8WDmLK/hTx7WYkx4mw2miNyia8=; b=GILEapDbNXdSetvhQDiHE99uKt+IQVr8mGYois18JeY1hmyd8tBQjSM4ICmGz9JVfm LLxUdcwxfp/zdLXpK6wPvQ7wSYOGx7DIpPoYLmlVHbUgOMnPWoIAPBpzJ0sBo1uVIpWC iJjdTiCt76OWwGSuTtxLHG0+VsxsdNpQ1sXU4JTnICGT7da9BQTzcVIaI/2aanUu8bl2 rIAC8SfupNro/j2Zxle2il/fkhUJUHPhW2r8vdwoSFaPploljNCKoIS0e84KH5V3p5gO Ufqfs/m1W/SxuwoBIObBXxKJC6vE0viSzwgO/Tb4VUwAgYjorM9ixvFYdbNPyJQ6wsor uaUQ== X-Gm-Message-State: AJaThX7VYSr86CiwZAMsuOm1PRuh+wtP59D4X+kzNXq0rFlJowL7lC/S SYw7tlsc5YdtaBTfCe5n3VFuc8Kii8Fc8dsJZUXTiA== X-Google-Smtp-Source: AGs4zMYDHoehPmKcqY92MoWOW9kWvP2m4DYeg3u7/i5i9v48mezUCpSNf6ZVM6+44CW4QD6VH054mjccncy2Hn+HVXg= X-Received: by 10.200.3.150 with SMTP id t22mr5729501qtg.156.1510305181427; Fri, 10 Nov 2017 01:13:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.99.85 with HTTP; Fri, 10 Nov 2017 01:13:00 -0800 (PST) In-Reply-To: References: <5A0308B6.5050300@ice-sa.com> <5A033CC6.40606@ice-sa.com> From: shivashankar manukondu Date: Fri, 10 Nov 2017 10:13:00 +0100 Message-ID: Subject: Re: non www to www URL Rewrite To: Tomcat Users List Content-Type: multipart/alternative; boundary="f40304352fa4d76cdc055d9d5377" archived-at: Fri, 10 Nov 2017 09:13:13 -0000 --f40304352fa4d76cdc055d9d5377 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, If you want both should be accessible then try to use "ServerAlias" option If you want redirect all requests then try RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteCond %{HTTPS} ^on$ #if you don't want https then make off RewriteRule ^(.*)$ https://www.example.com/$ [R=3Dpermanent,L,NE] # flags based on your requirement Please remember the above rules will be work based on all your existing rewrite rules. Regards, Siva On Thu, Nov 9, 2017 at 10:58 AM, RAVIRAJ SHAH wrote: > Hi Andre, > > Thanks for quick reply > yes it is pointing to same public IP > > Thanks, > Raviraj > > > > Thanks & Regards, > Raviraj Shah > > > On 8 November 2017 at 22:50, Andr=C3=A9 Warnier (tomcat) = wrote: > > > On 08.11.2017 17:35, RAVIRAJ SHAH wrote: > > > >> Sorry for my language > >> my query with example > >> > >> Let's say my website domain is "example.com" > >> Now I want to redirect "example.com" to "www.example.com" > >> Kindly share how I can achieve it > >> > > > > Well first, you need the 2 entries in the DNS server for "example.com". > > You need : > > example.com --> public Internet IP address of your server (A) > > www.example.com --> public Internet IP address of your server (B) > > > > and A =3D=3D B > > > > otherwise it will never work. > > Do you have that ? > > > > You can check this by getting a command-line window somewhere and > entering > > : > > nslookup example.com > > nslookup www.example.com > > and both should give the same IP address. > > > > > > > > > > > >> On Wed, Nov 8, 2017, 19:08 Andr=C3=A9 Warnier (tomcat) > wrote: > >> > >> On 08.11.2017 14:30, RAVIRAJ SHAH wrote: > >>> > >>>> Anybody please help > >>>> > >>> > >>> I think that you first try to communicate more clearly what you want = to > >>> achieve. > >>> "redirect non-www URL to www URL only" > >>> does not appear to make much sense. > >>> > >>> Also please send your message to the list as *plain text*, not html. > >>> It will make it easier to read configuration lines below which look > like > >>> URL's. > >>> > >>> > >>> > >>>> On Tue, Nov 7, 2017, 12:00 RAVIRAJ SHAH > >>>> wrote: > >>>> > >>>> Dear All, > >>>>> > >>>>> Kindly request you to help to resolve this issue > >>>>> > >>>>> Problem Statement : > >>>>> we want to redirect non-www URL to www URL only > >>>>> > >>>>> Current setup : > >>>>> > >>>>> Defined rewrite valve in server.xml as below > >>>>> > >>>>> > >>>>> >>>>> autoDeploy=3D > >>>>> "true"> > >>>>> > >>>>> > >>>>> > >>>>> >>>>> .valves.rewrite.RewriteValve" > >>>>> > >>>> /> > >>> > >>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> Created rewrite.config file in ../conf/Catalina// > >>>>> > >>>>> > >>>>> *RewriteCond %{HTTP_HOST} !^(.*)\.yourdomain\.com$ [NC] RewriteRule > >>>>> > >>>> ^(.*)$ > >>> > >>>> http://www.yourdomain.com /$1 [R=3D301,L]= * > >>>>> > >>>>> *kindly do needful* > >>>>> > >>>>> Thanks & Regards, > >>>>> Raviraj Shah > >>>>> > >>>>> > >>>>> > >>>> > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >>> For additional commands, e-mail: users-help@tomcat.apache.org > >>> > >>> > >>> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > --=20 Regards Siva #068860592040 --f40304352fa4d76cdc055d9d5377--