Remove Article ID from Joomla 3 url

2019-05-21 04:00发布

问题:

I am trying to remove article id from Joomla 3 URL. I searched around and the response is in

components\com_content\router.php

change 0 to 1 in $advanced = $params->get('sef_advanced_link', 1);

on lines 38 and 290

and also comment out

if (strpos($segments[0], ':') === false) { $vars['view'] = 'article'; $vars['id'] = (int)$segments[0]; return $vars; }

I consider it works fine in Joomla 2.5 as all comments mention this.

But it does not do the job for me on my Joomla 3.3 website.

How can I achieve this without creating menu items for each article?

回答1:

Instead of doing it in the filesystem and modify the Joomla core, you can do this by modifying the com_content row in the extensions table as described here: http://www.itoctopus.com/how-to-remove-the-article-id-from-joomlas-sef-urls (the 2 methods are described in that URL, the filesystem method and the database method)

Note that this is tested on Joomla 3.x and it should work. If it doesn't work for you then most likely you will need to clear your Joomla cache.



标签: php joomla