I wrote a component and made a router.php by documents in Joomla.org. My problem is that how can I remove item view from URL?

For example I have this view -> musicses, now my SEF URL is like this


I want change it like this : /music/music77.html
music77 is my title for this post,

This is my code:


  • Link to your code is not working
    – Lodder
    Apr 11, 2016 at 10:24
  • Approved the edit, but why was it made by a completely different user? Are you using 2 separate accounts? If so...any reason?
    – Lodder
    Apr 11, 2016 at 10:56

1 Answer 1


Take a look into the com_content router, category blog view works like that, shows a list of articles under domain.com/blog and the links are generated like domain.com/category/1-my-first-article

But it also allows something like this:


Therefore you have to change your link generating (JROUTE) in your component for the item, removing the item view. You can manually build the link to by parsing just the route to the list view, attaching the item alias to the url string.

This could be helpful too:


(I don't do that for my components I just redirect everything to the main view and then check the segments with an external router class.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.