CodeIgniter Forums
routing and pagination problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: routing and pagination problem (/thread-54997.html)



routing and pagination problem - El Forum - 10-04-2012

[eluser]Unknown[/eluser]
Hay everyone,

my real link is:
LINK 1: http://www.example.com/controller1/method1/this-is-a-link

but i want this link
LINK 2: http://www.example.com/this-is-a-link

For this LINK 2: i put this code in route.php
code 1:

$route['(:any)']='controller1/method1/$1';
And I am successfully get LINK 2:, it works well

But my main problem is when i add code 1: All of my URI effected AND every link has to be manually edit in route.php

suppose my another link is

LINK 3: http://www.example.com/controller2/method2/this-is-another-link

but i want this link
LINK 4: http://www.example.com/this-is-another-link

For this LINK 4: put this code in route.php
code 2:

$route['(controller2/method2)']='controller2/method2';



it is disgusting when, every link explain with route.php

the pagination problem is when i enter any page how can i define routing if CODE 1
is already declare

suppose, i want paginate home.php
the url look like
http://www.example.com/home/1
http://www.example.com/home/2
http://www.example.com/home/3 etc

if the code1 do not use i can use any link without routing
but i need link2

how can i define pagination link in route.php when code1 is already define?