Note: The steps in this article will work for Joomla 3+ versions prior to 3.7.The router.php file has changed in more recent versions of Joomla.

For Joomla 3.7+, please refer to this documentation:

https://joomla-extensions.kubik-rubik.de/forum/cms-joomla/8023-joomla-articles-without-ids-in-url-joomla-artikel-ohne-ids-in-der-url#9023


If an article is displayed on your Joomla website as part of a Category Blog or Category List, the URL will display its id number.

For example:

http://bj.zemplate.com/protostar-responsive-template/how-to/44-how-to-copy-and-rename-the-protostar-template

Many people do not like this being in the URLs for their web pages.

It is possible to not have this happen.

Per this post in forum.joomla.com

http://forum.joomla.org/viewtopic.php?f=706&t=865411

You can replace the components/com_content/router.php file with the one provided in the post shown above.

Do this at your own risk - we are neither recommending this step or not recommending this step. We are simply stating that this can be accomplished.

What is different with this router.php file?

After studying this file provided in the post with the standard router.php that came with a Joomla 3.6.0 installation we found three lines were changed (line numbers may vary slightly):

Line 34:

$advanced = $params->get('sef_advanced_link', 1);  
/*******CHANGED FROM 0 TO 1**********/


Line 294:

$advanced = $params->get('sef_advanced_link', 1);
/*******CHANGED FROM 0 TO 1*********/


Line 327:

if($count == 1 AND empty($advanced))
/*****THIS IS CHANGED TO ADD THE "AND empty($advanced)"*******/

Things to consider when taking this step

Issue A: If your site has been up for a long time, and Google and other search engines have indexed your pages, the indexed URLs will all be incorrect for the pages with the index numbers removed.

This means that those links will be broken. You can get around this with redirects in your .htaccess file and resubmitting your site to Google and other major search engines.

Issue B: If you upgrade your site, you will need to remember replace the edits made to the router.php file with each upgrade, or your URLs will go back to having the id number shown for these pages.

Issue C: If your visitors have bookmarked the pages with the id numbers, these will be broken links if you do not create redirects.

Issue D: If you have internal links that point to the urls with the id numbers, you should edit those to the new urls.

Issue E: If you do take this step, test your site extensively. Especially if you have other contributors that may have hard-coded the URLs for internal links.

When is the best time to take this step?

The best time to take this step is when you are first developing the site, so that the id numbers are not part of the system from the start.