httpd-users mailing list archives

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


Mime
View raw message