Welcome Guest, Not a member yet? Register   Sign In
take out control and view in the url
#1

[eluser]wan19800[/eluser]
does anyone know how to take out control and view in the url structure in codeigniter

ex)
http://www.url.com/control/view/segment3

to

http://www.url.com/segment3


I try .htaccess, it does not work.
any suggestions??


thanks
#2

[eluser]gon[/eluser]
EDIT:

Try setting a route:

Code:
$routes["(:any)"] = "controller/action/$1";

You only can access one controller and action though.
#3

[eluser]wan19800[/eluser]
nothing seems to work

I try

$route['search'] = "controller";
$route["(:any)"] = "controller/view/$1";


and I want to pass

http://www.url.com/control/view/segment3

to

http://www.url.com/segment3



the segment3 will not pass value
#4

[eluser]gon[/eluser]
Using the route I proposed, the argument should be passed to the action, as in a normal URL:

/controller/action/arg1/arg2

in this example the action() method would get 2 params: the values arg1 and arg2.




Theme © iAndrew 2016 - Forum software by © MyBB