![]() |
Help with pagination and mod_rewrite(Solved) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Help with pagination and mod_rewrite(Solved) (/showthread.php?tid=25177) |
Help with pagination and mod_rewrite(Solved) - El Forum - 12-03-2009 [eluser]fraserk[/eluser] Hi Everyone. I'm creating my first project in codeigniter and have run into a little problem. I think because I am using mod_rewrite to remove the index.php from my url the pagination is not working. When you click to go the the second page in the pagination link, it giving a 404 page not found error. Pagnation Code in Controller Code: $config['base_url'] = "http://www.goingclubing.com/"; Code in Model Code: $query = $this->db->get('events', 20, $this->uri->segment(3)); htaccess Code Code: RewriteEngine on Im not sure what I should I should use for the ['base_url']. Thanks... Help with pagination and mod_rewrite(Solved) - El Forum - 02-22-2014 [eluser]therealjerdev[/eluser] [quote author="fraserk" date="1259856615"]Hi Everyone. I'm creating my first project in codeigniter and have run into a little problem. I think because I am using mod_rewrite to remove the index.php from my url the pagination is not working. When you click to go the the second page in the pagination link, it giving a 404 page not found error. Pagnation Code in Controller Code: $config['base_url'] = "http://www.goingclubing.com/"; Code in Model Code: $query = $this->db->get('events', 20, $this->uri->segment(3)); htaccess Code Code: RewriteEngine on Im not sure what I should I should use for the ['base_url']. Thanks...[/quote] I'm definitely having the same problem. Is there a fix? Help with pagination and mod_rewrite(Solved) - El Forum - 02-22-2014 [eluser]CroNiX[/eluser] base_url should be http://yoursite.com/controller/method/ Then it will add the page number to the 3rd segment for all paginated links Help with pagination and mod_rewrite(Solved) - El Forum - 02-22-2014 [eluser]therealjerdev[/eluser] [quote author="CroNiX" date="1393125370"]base_url should be http://yoursite.com/controller/method/ Then it will add the page number to the 3rd segment for all paginated links[/quote] Wow thanks so much. It finally works lol. Does CodeIgniter mention that in its userguide/references? Because I believe I haven't seen such documentation. Help with pagination and mod_rewrite(Solved) - El Forum - 02-22-2014 [eluser]CroNiX[/eluser] Yes, in the very first example, and just below that it says: Quote:base_url This is the full URL to the controller class/function containing your pagination. In the example above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can re-route your URI if you need a different structure. |