Forum Moderators: coopster

Message Too Old, No Replies

problem in clean url pattern ?

         

PHPycho

8:09 am on Oct 3, 2008 (gmt 0)

10+ Year Member



Hello forums!

I would like to know, how to handle the '/' as params in clean urls.
The url pattern is like:

http://localhost/mysite/mycontroller/mymethod/key1/val1/key2/val2 ...

Suppose the case:
key1 = filepath
val1 = uploads/docs/abc.doc

So in this case the clean url pattern which is separated by / will be violated.

So i would like to know how to use param values with '/' so as to preserve the pattern.

Thanks in advance for the valueable suggstions.

g1smd

8:31 am on Oct 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am guessing something like this... and it relies on the period in the
.doc
part.

^controller/mymethod/([^/]+)/
- gets you key1 (everything after mymethod and up to next /) into $1.

(([^.]+)\.([^/]+))/
gets you val1 (everything up to period and the period and everything up to next /) into $2.

I might have put too many brackets into the above, maybe this will work for second part:

([^.]+\.[^/]+)/
- one or more characters that are not a period, followed by a period, followed by one or more characters that are not a slash.