In order to fulfill,your requirement , need to implement custom route
.
By using custom route,your requirement will be fulfilled.
How to implement custom route see.
if you have using Ivan answer then you need to modification at match() function
basic of your logic & requirment
Use Core Rewrite:
Also if do not use custom route then use magento Core rewrite
and use clockworkgeek .
$rewrite = Mage::getModel('core/url_rewrite');
$rewrite->setStoreId($store_id)
->setIdPath('news/'.$id)
->setRequestPath('news/detail/id/'.$id)
->setTargetPath('news/detail/index/id/'.$id)
->setIsSystem(true)
->save();
Here i assume, details
is Controller name =DetailsController.php
index is an action name
of DetailsController.php
controller.