One thing is, that you're trying to create a router in the old way, it changed over time. Now router is a class. Second thing is, one of your component views have to be set as a front-page for a system. Without that, in most websites the default router will be com_content's router, so every wrong URL(url that don't have a proper menu item/parent item) will be handled by `com_content` and most likely return 404. If you want to handle SEF urls for a pages that don't have a proper menu item its a must. 


## Example component router
You can find a proper example router in the link below, but have in mind that in one of the next version of Joomla! the way you build the router will change again (if they get rid of the bugs).

https://github.com/joomla-extensions/weblinks/blob/master/src/components/com_weblinks/router.php