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 BEEB1200D39 for ; Sat, 11 Nov 2017 10:18:16 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BD633160C03; Sat, 11 Nov 2017 09:18: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 DD681160BF1 for ; Sat, 11 Nov 2017 10:18:15 +0100 (CET) Received: (qmail 51786 invoked by uid 500); 11 Nov 2017 09:18:14 -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 51774 invoked by uid 99); 11 Nov 2017 09:18:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Nov 2017 09:18:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 74159C2AD9 for ; Sat, 11 Nov 2017 09:18:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.129 X-Spam-Level: ** X-Spam-Status: No, score=2.129 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, 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: spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id xHTOZDQzm8wh for ; Sat, 11 Nov 2017 09:18:12 +0000 (UTC) Received: from mail-ot0-f178.google.com (mail-ot0-f178.google.com [74.125.82.178]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id B735C5F3CD for ; Sat, 11 Nov 2017 09:18:11 +0000 (UTC) Received: by mail-ot0-f178.google.com with SMTP id q99so10096560ota.2 for ; Sat, 11 Nov 2017 01:18:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=RiBK0tvx0ukFCAWsxfUdeYWIV4fyWL1GQqunxLT9dR8=; b=kbPi0uSlmJLg7k1FCQwkaArVrGqMDEsg4WgcC4XzXoRaL2yyWBiuwIEYlyOEiuqw3j W0SCBzUlNAMA2yeQ1tCLBphwu4lAGt+GEJC5Dxf/XNgQzh2tHO7jq/uOPLIeaaJYBhPM Ehn6y5NyxkW7XAkzd+rIZ5WGJJSedF63MNbIG3KTif0kopatAPwoXGnlqOeyi5K0fS8z z/G7nSOVawYJHRYTA9lRnlZzi0t/VLjcHpr/wAnbqcpdohJw+Mflxu6q1H5ZkC/eDUe0 jxKxypILdA9bgLuLfSdQJwvmUrNpCQAi+bsa08hslEOZ3wK/EP6MwG8sxfu8jvUHfq4R miqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=RiBK0tvx0ukFCAWsxfUdeYWIV4fyWL1GQqunxLT9dR8=; b=TlE/2/E+qCp7h2dg/Pjox4zIOmED0jsOsON0jb0kOHL5awd10p48gK0Ikd7kt5GD/H Pk0Z8fCsldcFdd/uz/A0cazHz2hEfuV5Cf84e9U+b/v24wVms/gOdPG2pPYATw6G0qNG Di+2jFUxDDUtc2swoLse/hCRufylztZGe/ntdlpTZ5uK/ZTzh9KTrwNwA65M6TEVOiDi o7/IyJnkqBOo+4TfQuXR9s/AgW1s9P9ya80OlugHtSOjPAV4+ZGSoiwcSXt3W9isl9QB imDAlbQktLT34WZQGOpJcAR+IWsFYj/c+QrjRoL1atHSi+HTobLTj7QkPw2TJaneV2Xo XhkA== X-Gm-Message-State: AJaThX7hYnL6OsOqVDfdCeHM4TdMlgi6qub+nhwZkI3YADHJ5C+HxiIU QXc1hElECz6VMM2ptR/xxXd1BS2GD/J3LnH9oUo= X-Google-Smtp-Source: AGs4zMbnEgQoi1ez0jfYSIqbNNKSDmtEKKsVbxyW11I4pfZsGpghJrUBvbCqqNmBckGBfDIw/tjGYl9ImqAMUEwD3+Q= X-Received: by 10.157.73.162 with SMTP id g34mr1794482otf.449.1510391885043; Sat, 11 Nov 2017 01:18:05 -0800 (PST) MIME-Version: 1.0 References: <5A0308B6.5050300@ice-sa.com> <5A033CC6.40606@ice-sa.com> In-Reply-To: From: RAVIRAJ SHAH Date: Sat, 11 Nov 2017 09:17:53 +0000 Message-ID: Subject: Re: non www to www URL Rewrite To: Tomcat Users List Content-Type: multipart/alternative; boundary="f4030437a0bcc79d11055db183ae" archived-at: Sat, 11 Nov 2017 09:18:16 -0000 --f4030437a0bcc79d11055db183ae Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks shiv, But no luck it is not working I did configuration as below Created rewrite.config file in ../conf/Catalina/example.com RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteCond %{HTTPS} ^on$ RewriteRule ^(.*)$ https://www.example.com/$[R=3Dpermanent,L,NE] And added valve as below in server.xml Do guide if anything to correct or any other solution On Fri, Nov 10, 2017, 14:43 shivashankar manukondu < sivasankar.manu@gmail.com> wrote: > Hi, > > If you want both should be accessible then try to use "ServerAlias" optio= n > > 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 wan= t > 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] RewriteRu= le > > >>>>> > > >>>> ^(.*)$ > > >>> > > >>>> 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 > > > > > > > > > > > > -- > > Regards > Siva > #068860592040 > --f4030437a0bcc79d11055db183ae--