Can I change the joomla router for the canonical url of some categories?

460 views Asked by At

I have a few hundred articles that belong in 3 categories which are nested in a main one. The sef url which is produced by joomla goes like this

mydomain.com/ (menu item alias for the top level category that nests the 3)/ (the articles parent category id and alias)/ (article id and alias)

I want all articles url to have this structure mydomain.com/ (menu item alias for the top level category3)/ (article id and alias)

without having to create seperate menu items for all of them

the second url already works (since there is a menu item for a blog with the top category) but it's not the default one (that joomla outputs on links to the article, the article's head as well as the

is there any way to change the router php file and do this? or at least modify the main helper files that produce the output and

1

There are 1 answers

0
Jiwoks On

You can create a custom system plugin. Here is the Joomla documentation : http://docs.joomla.org/Creating_a_System_Plugin_to_augment_JRouter

With two methods you can :

  • alter the url generation
  • Parse the requested url to redirect to the content you want