httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shpau <sh...@school.net.hk>
Subject Re: mod_rewrite question, thanks
Date Fri, 17 May 2002 01:25:12 GMT
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


Mime
View raw message