|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Regex Route
Hello,
I created a RegexRoute and i am trying to use it as unique route for a website:
I am trapping fine all url's containing all params but i can't trap any URL which contain less params, even if i already submitted some default values for missing params. Sample: i can't trap www.domain.com Sample: i can trap www.domain.com/blabla-1_2_3_4 How i should update the Regex route to trap all cases ? (with missing params). Cristian |
|
|
Re: Regex RouteHi Christian - the trailing underscore is still a requirement in the way you have constructed your route. For example, your sample would match the following:-
You just need to make the parameter and the underscore optional:- routes.common.route = "([^_]*)-([^_]*_)?([^_]*_)?([^_]*_)?([^_]*) Cheers
-- Simon Mundy | Director | PEPTOLAB """ " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" " 202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000 Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124 |
|
|
Re: Regex RouteThanks for reply. With few corrections the rule would work perfectly - still testing now. Anyway there is one more problem: in case i am calling www.domain.com the params won't be initialized with default values.... No idea why... Cristian Hi Christian - the trailing underscore is still a requirement in the way you have constructed your route. For example, your sample would match the following:- |
| Free Forum Powered by Nabble | Forum Help |