Ok, let's say i need to use seo urls. How could i manage the following pattern:
www.mysite.com/{context}/{mode}/
That allows get variables declared as follow:
www.mysite.com/{context}/{mode}/{var}/{val}/{var2}/{val2}...
For example:
www.mysite.com/user/view/id/123
?
Solution?, How to do that?
A possibly solution could be the following:
All url are redirected to www.mysite.com/index.php.
In the index.php file i divide the url by $u = explode($ulr, '/');
: ignoring $u[0]
and considering $u[1]
as the context, $u[2]
as the mode and eventual $u[3], $u[4]...
as couples of var-values like get system index.php?var=val
.
By knowing the context and the mode the right file is included and everybody is happy.
- How could i get the url (es: www.mysite.com/user/view/id/123) or just the last part (es: user/view/id/123)?
- Is this system has any cons?