Q:

How to hide one part of URL and redirect it?

I have URL segment:
http://www.site.com/loadContent/contact/4
I want to hide the ID 4 in browser address bar:
http://www.site.com/loadContent/contact
Both contact and 4 are loading dynamically
How can I do that in my code?
Updated:
I have to passe $pageID as second parameter
I have a function that generation menu list items:
function buildListItem($item) {
$urlItemName = url_title($item->name, 'dash', TRUE); 
$urlCatID = ($item->cat_id);
$url = base_url() . $urlItemName . "/". $urlCatID;

if ($urlItemName == 'blog') {
    $blog = "http://blog.tumblr.com";
    return anchor($blog, strtoupper($item->name), 'target="_blank"');
} else {
    return active_anchor($url, strtoupper($item->name));
}

}
public function loadContent($name, $pageID) {
    $data['title'] = $this->tabPageData;
    $data['tabMenu'] = $this->model->getAllMenuItems();
    $data['links'] = $this->model->getLinksURLIcon();

    $pageName = array('portfolio-1', 'portfolio-2');

    // Store pageID within Session
    //$sessionPageID = $this->session->set_userdata($this->uri->segment(2));

    // Check if $name is in array pageName, get the page content and its name
    if (in_array($name, $pageName)) {
        $data['tabPageContent'] = $this->model->getPageContentByPageID($pageID);
        $data['pageName'] = $this->model->getPageNameByID($pageID);
    } elseif ($name == 'contact') {
        // load Contact page
        $data['tabContact'] = $this->model->getContactByPageID($pageID);
    }

    $this->load->view('content', $data);
}

A:

You must first, get id number and save in $_SESSION and ofter this work, you use preg_match giving ,one string of url without id number .
in end you redirect url use <?php header("location: ". $URL") ?>

