Welcome Guest, Not a member yet? Register   Sign In
Can I remove the controller name from the url?
#1

[eluser]Unknown[/eluser]
Hello, CodeIgniter forums!

I have run into an interesting problem, and I can't figure out how to solve it elegantly.

My CodeIgniter installation is not in my web root, but in a sub folder called dvd_collection. My idea was to use urls like "dvd_collection/browse", "dvd_collection/search" etc. The problem is that the controller name needs to come before the functions, producing the, to me, ugly urls "dvd_collection/controller_name/browse" and "dvd_collection/controller_name/search" instead.

I have come up with two ideas to solve this, but I don't like either of them.

1. Moving CodeIgniter to my root, making it the center of my whole website, which I would not like.
2. Creating a contoller for each and every function. This is not only ugly, but the same problem with double url parts would arise with "controller_name/function_name" instead of "folder_name/controller_name" whenever I want to pass parameters to a function (the first parameter after the controller name is always the function name, I believe).

Have anyone had similar problems, or is there a solution I haven't found out about?

Thanks for any help.

//Johan


Messages In This Thread
Can I remove the controller name from the url? - by El Forum - 05-06-2009, 02:00 PM
Can I remove the controller name from the url? - by El Forum - 05-06-2009, 02:02 PM
Can I remove the controller name from the url? - by El Forum - 05-06-2009, 02:17 PM
Can I remove the controller name from the url? - by El Forum - 05-06-2009, 02:22 PM
Can I remove the controller name from the url? - by El Forum - 05-07-2009, 04:22 AM
Can I remove the controller name from the url? - by El Forum - 05-07-2009, 07:05 AM
Can I remove the controller name from the url? - by El Forum - 05-07-2009, 07:22 AM
Can I remove the controller name from the url? - by El Forum - 05-07-2009, 07:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB