CodeIgniter Forums
friendly urls? how to - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: friendly urls? how to (/thread-31407.html)



friendly urls? how to - El Forum - 06-17-2010

[eluser]metaprinter[/eluser]
i've been handed a completed site that the client now wants to
1. make the url's friendly
right now i have: http://www.example.com/user/products/ContainersCat/1
buth they want http://www.example.com/user/products/boxes/metal
http://www.example.com/user/products/boxes/cardboard

etc...
Can someone push me in the right direction on what i need to do here? ps. i have no idea what version of codeigniter this site was built on .

thanks


friendly urls? how to - El Forum - 06-17-2010

[eluser]Slowcheetah[/eluser]
check http://ellislab.com/codeigniter/user-guide/general/controllers.html


friendly urls? how to - El Forum - 06-18-2010

[eluser]Ngua Go[/eluser]
What's metal and cardboard?
is products's Alias ?
if alias then query with alias (not with ID)


friendly urls? how to - El Forum - 06-22-2010

[eluser]metaprinter[/eluser]
i'm not understanding where the url is being generated from i think is what my major problem is. Do i need to change something in the database or some php code? if the code, then where? in the product.php controller?

in products.php i have this to start

class Products extends Controller{

//constructor
function Products(){
parent::Controller();
blah blah blah

do i need another function like
function boxes()
{
all my boxes stuff;
}

am i headed in the right direction?


friendly urls? how to - El Forum - 06-22-2010

[eluser]mi6crazyheart[/eluser]
@metaprinter
If u want to change this url "http://www.example.com/user/products/ContainersCat/1" to like this... "http://www.example.com/user/products/boxes/metal"

then u've to check... from where & how those parameters(ContainersCat & 1)are generating. Accordingly after that u can replace those parameters by new one(boxes/metal)...


friendly urls? how to - El Forum - 06-23-2010

[eluser]SpooF[/eluser]
A huge help when it comes to modifing your URLs

http://ellislab.com/codeigniter/user-guide/general/routing.html