Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 78357 invoked by uid 500); 17 May 2002 01:21:23 -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: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 78338 invoked from network); 17 May 2002 01:21:22 -0000 Received: from sun5.school.net.hk (202.45.183.5) by daedalus.apache.org with SMTP; 17 May 2002 01:21:22 -0000 Received: from there (pc5.school.net.hk [202.45.183.68]) by sun5.school.net.hk (8.12.3/8.12.3) with SMTP id g4H1LSFf010222 for ; Fri, 17 May 2002 09:21:29 +0800 (CST) Message-Id: <200205170121.g4H1LSFf010222@sun5.school.net.hk> Content-Type: text/plain; charset="Big5" From: shpau To: users@httpd.apache.org Subject: Re: mod_rewrite question, thanks Date: Fri, 17 May 2002 09:25:12 +0800 X-Mailer: KMail [version 1.3.1] References: <200205160834.g4G8YRlI022965@sun5.school.net.hk> <20020516122649.C959@cyan.csp.org.by> In-Reply-To: <20020516122649.C959@cyan.csp.org.by> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: : ok X-Scanned-By: MIMEDefang 2.11 (www dot roaringpenguin dot com slash mimedefang) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Dear Artiom Morozov, Many Thanks to you. Albert On Thursday 16 May 2002 05:26 pm, you wrote: > Try this in virtualhost > > RewriteEngine on > RewriteCond %{REQUEST_URI} /........./index.html > RewriteRule /(...)(...)(...)/(.+) /$1/$2/$3/$4 [PT] > > see http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#rewriterule > and regex(7) man > > �� 2002.05.16 11:38 shpau ������?: > > Dear All, > > I am trying to set URL rewrite using RewriteRule directive, > > and I want to do > > the following : > > > > original type in URL : www.mydomain.com/123abc789/index.html > > > > ReWrite to : www.mydomain.com/123/abc/789/index.html > > > > Actually, if I already known the middle part, e.g. > > '123abc789', then I can > > rewrite to the target URL, but if the pattern of this 9 char / digits > > always > > change, only the length remains unchanged, e.g. the pattern always > > have 9 > > char / digits, how can I set the RewriteRule ? > > > > Because if the type in URL pattern always change, I cannot > > hard-coded in the > > ReWriteRule to something /123/abc/789/index.html, can I using any > > regular > > expression to try to catch the first 3 char / digits, then catch next > > 3 and > > last 3 one ? > > > > e.g. if this time type in www.mydomain.com/333666999/index.html > > > > then will catch the first 3 digits, middle 3 digits and last 3 digits > > and > > ReWrite to : > > > > www.mydomain.com/333/666/999/index.html > > > > > > Would you mind to give me some advices or share your > > experiences about that ? > > Thank you very much for your help. > > > > From > > Albert > > > > --------------------------------------------------------------------- > > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org