CodeIgniter Forums

Full Version: Removing Page/id's ?...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]masson[/eluser]
Hey Guys,

I have been working on a personal small CMS, so for it is going quite nice. However i have some issues changing the URL rewriting for pages.

Now it's http://www.mydomain.com/page/2/services but what i really wan't is http://www.mydomain.com/services

I'm getting quite a headache since i know it can't be that hard. I really would appreciate if any one could help me out.

Regards,
Masson

El Forum

[eluser]├╝berfuzz[/eluser]
Could you give an example of how you set up a controller to your site. Lets say you have a page called home.

Code:
<? if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends MY_Controller
{
    function Home()
    {
        parent::__construct();
    }
    

    function index()
    {
        $this->data['some_data'] = 'some_data';
        $this->load->view('home', $this->data);
     }
}

El Forum

[eluser]├╝berfuzz[/eluser]
Ops, hard to get the point in my post. Do you think CI when you set up your controller/pages? There are ways of setting up a dynamic page system. But do you really need that for a small personal site?

El Forum

[eluser]w0bbes[/eluser]
Any examples on how to setup a dynamic page system, ive been wondering about this aswell.

El Forum

[eluser]Kamarg[/eluser]
Perhaps by using the built in Pagination class like the user guide suggests?

El Forum

[eluser]w0bbes[/eluser]
[quote author="Kamarg" date="1257909991"]Perhaps by using the built in Pagination class like the user guide suggests?[/quote]

Read first, then respond please.

El Forum

[eluser]eoinmcg[/eluser]
I'm sure there are a more than a few ways to so this but one method I use is to extend the Router class.

You can find a fully working example here:
http://ellislab.com/forums/viewthread/107451/#541043