Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- ReWriteRuel and Regular Expressions
September 20, 2005, 12:02 am
rate this thread
My apologies if this is the wrong group to post to on this subject, and
any guidance to the correct group would be appreciated.
I am attempting to create a RewriteRule entry [for URL rewriting] and I
am uncertain if what I would like is even possible.
Assuming a URL of the format abc_def_hij.html is requested, and need to
be written as script.php?x=abc&x=def&x=hij, I can do regexp to
successfully do the rewrite on that.
The problem is that the number of words with underscore separators is
unknown, so I could need to rewrite abc_def.html, or
abc_def_hij_klmnop_qrst_tuv_wxyz.html - I won't have knowledge of the
request in advance (although there will be a practical limit of no more
than about 10 "parameters" in total.)
Is there a regexp that can help out in this instance, or should I tell
the client his hopes and dreams have been mercilessly shattered? ;-)