#Magento 1 #config.xml
<controller_front_init_routers>
<observers>
<vender>
<class>Vender_Model_Controller_Router</class>
<method>initControllerRouters</method>
</vender>
</observers>
</controller_front_init_routers>
#Router Class
class Vender_Model_Controller_Router extends Mage_Core_Controller_Varien_Router_Abstract
{
public function initControllerRouters($observer)
{
$front = $observer->getEvent()->getFront();
$front->addRouter('vendor_router', $this);
}
//logic for matching route will be inside this
//if we have config setting for each stores we can retrieve request path info
// and manipulate and assign controller and params and set alias
public function match(Zend_Controller_Request_Http $request)
{
}
}