Joomla use own SEF redirects what drives any variants of URL to same article basing on Article ID (no matter what alias will be used)


or http://example.com/3-welcome-to.html

or http://example.com/3.html

all above drive at the same article.

My question - where is a part of code responsible for such a behaviour ?

Because I'd like to comment (disable) this part of code what is convenient feature sometimes, but in my case I need TO SAVE Joomla article IDs in URL - but Joomla should answers only to Article ID with EXACT alias


all other "URL variations" like

http://example.com/3-welcome-to.html etc

should give natural 404 error.

I don't create a module or plugin, I just want to change default Joomla SEF routing to set "Article ID + exact alias only" if it's possible.

Thx in advance for any opinions or ideas to try (excluding idea "disable Article IDs through Admin settings" - as said above I need to save the ones)

  • Thank you for joining JSE and contributing. Please take our tour. If you think users are misunderstanding your question, you may wish to edit it to improve the clarity. May 13, 2021 at 3:39

1 Answer 1


May not be practical for blog articles, but a fixed url can be achieved via menu items: https://docs.joomla.org/Search_Engine_Friendly_URLs#Limitations

Otherwise, if I see it correctly, you have to write your own plugin. https://docs.joomla.org/Search_Engine_Friendly_URLs#Custom_Routing

  • Thx for pointing, but I don't think I need own plugin to OVERRIDE Joomla default behaviour, I just look is there a way to COMMENT/disable some lines in /components/com_content/router.php to allow only ID+exact alias...this case I suppose we remove some functionality, not override or add the one...may be my logic is wrong - this is why I've asked the question here to read some opinions.
    – Serge
    May 12, 2021 at 20:58
  • 3
    Using a Plugin is how you can override core behaviour without editing the core files which is considered a no-no as your changes will get replaced when the core is updated. You may like to look at the onAfterRoute event as a place to start reading: docs.joomla.org/Plugin/Events/System
    – Irata
    May 12, 2021 at 23:10

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.