Return-Path: X-Original-To: apmail-sling-users-archive@minotaur.apache.org Delivered-To: apmail-sling-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B53998D9 for ; Tue, 7 Feb 2012 03:43:28 +0000 (UTC) Received: (qmail 51456 invoked by uid 500); 7 Feb 2012 03:43:26 -0000 Delivered-To: apmail-sling-users-archive@sling.apache.org Received: (qmail 51193 invoked by uid 500); 7 Feb 2012 03:43:14 -0000 Mailing-List: contact users-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@sling.apache.org Delivered-To: mailing list users@sling.apache.org Received: (qmail 51180 invoked by uid 99); 7 Feb 2012 03:43:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 03:43:10 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HS_INDEX_PARAM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of davidjgonzalez@gmail.com designates 209.85.161.178 as permitted sender) Received: from [209.85.161.178] (HELO mail-gx0-f178.google.com) (209.85.161.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 03:43:03 +0000 Received: by ggmi4 with SMTP id i4so3396780ggm.9 for ; Mon, 06 Feb 2012 19:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type; bh=2fCrDsUmDTXENbp4oHSfoyKEbB2COUTPkSfUPMEoqCU=; b=ugao5ARJoFEHRqoiAsXGa7YEkwBlmeaiptOmHOmgWtsz5Gx9q+HaACImwDdhlWmBVE hdd0GkcD2oPY6NcmT438AJK2X6N3MDiKWRJiQebhGwVoLvyrNKMzdIqb4pvHyoQwtBXo fIVI4A5w6a11C5SyGavCdCoUm2v27a9hK1hrw= Received: by 10.236.156.67 with SMTP id l43mr29115548yhk.73.1328586162173; Mon, 06 Feb 2012 19:42:42 -0800 (PST) Received: from mba.local ([24.199.196.195]) by mx.google.com with ESMTPS id h36sm26290503yhj.6.2012.02.06.19.42.40 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Feb 2012 19:42:41 -0800 (PST) Date: Mon, 6 Feb 2012 22:42:42 -0500 From: "David G." To: users@sling.apache.org Message-ID: <32DEFFD0F835407FA7637D6EE4DBA3FD@gmail.com> In-Reply-To: References: <-6817350045038920643@unknownmsgid> Subject: Re: Sling URL Mapping Questions X-Mailer: sparrow 1.5 (build 1043.1) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="4f309db2_257130a3_217" X-Virus-Checked: Checked by ClamAV on apache.org --4f309db2_257130a3_217 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hey, I'm using dispatcher running under httpd as cache. One of the things I am trying to get around is serving pages from the usual /content///page.html structure. I need to validate, but I think I could 1) handle incoming rewrites: mysite.com/page.html > /content/mysite/en/page.html 2) use the JCR Resource Resolver mappings to rewrite all my in-page links to point at /page.html I haven't looked at the source code to see why sling can't handle bi-directional mapping when using regex (it seems like it should be able to, but I must be missing something). Thanks -- David Gonzalez Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Monday, February 6, 2012 at 12:29 PM, James Stansell wrote: > On Mon, Feb 6, 2012 at 5:26 AM, David Gonzalez wrote: > > > Does mod-rewrite support rewriting all the links in the documents > > returned in the response? > > > > > Probably not. In fact right now a lot of our links are > /content//en/page.html and we have rewrite rule which gives a > redirect to /page.html. > > It should be possible to use a sling filter to modify the links when > serving the page but we haven't looked into that yet. > > > > Have you seen perf hits doing this? (I'm assuming every html response > > must be parsed and rewritten.) > > > > > As far as I know our performance concerns are in other areas. Our sling is > actually part of CQ5 so we already were using httpd in order to host the > dispatcher plugin for caching the pages. Plus we are using mod_rewrite for > rewriting 1000s of legacy URLs so I don't think we ever considered another > option. > > > > Are there any gotchas w mod_rewrite that you've run into rewriting > > incoming and outgoing urls? > > > > > Our biggest problems have been with the legacy URLs. I guess a general > gotcha could be the regexes for the rewrite; not thinking of anything else. > > If we were using plain sling we would probably be caching with varnish. I > wonder if that has any rewrite support? Are you using a web cache? > > --4f309db2_257130a3_217--