Welcome Guest, Not a member yet? Register   Sign In
URI Routing
#1

[eluser]MWebber[/eluser]
Hi,
Is it possible to reroute something like

Code:
http://localhost/modules/articles/view/123

to

Code:
http://localhost/articles/view/123

with regular expressions or with URI Routing

[modules] is a folder inside controller folder
[articles] is the controller in modules folder
[view] is the function in articles controller
[123] is the vars
#2

[eluser]MWebber[/eluser]
bump
#3

[eluser]MWebber[/eluser]
bump
#4

[eluser]Lockzi[/eluser]
Hi, try something like this in config/routes.php:

Code:
//articles/view(or whatever)/123 points to
$route['articles/(:any)/(:num)'] = "modules/articles/$1/$2";

You can read more about it at: http://ellislab.com/codeigniter/user-gui...uting.html
#5

[eluser]MWebber[/eluser]
Thank you very much that helped me Smile

My solution -

Code:
$route['(:any)/(:any)/(:num)'] = "modules/$1/$2/$3";
#6

[eluser]Lockzi[/eluser]
Any time Smile




Theme © iAndrew 2016 - Forum software by © MyBB