my link is like this :
http://website.com/test1/test2/public/books/detail/page_id/number/page/2
I want to remove page and 2 and convert it to :
http://website.com/test1/test2/public/books/detail/page_id/number
I can define last part of URL with :
$uri = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
$part = basename($uri);
or define another part like this :
$parts = Explode('/', $uri);
$id2 = $parts[count($parts) - 2];
$id1 = $parts[count($parts) - 1];
but I have problems to remove that