I have some sections of my web in joomla that are accessed like this:
I want to transform in something like that:
replace the old name with the new one: com_component --> com_newname
It's possible? How can I do it?
(Edit)
I've tried to edit .htaccess file (mod rewrite) with:
RewriteCond %{QUERY_STRING} ^(.*)com_component(.*)$
RewriteRule ^(.*) $1?%1com_newname%2 [R=302,L]
but it does not work well... It shows url local too
Edited: I've tried to modify
public function onAfterRoute()
{
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
if ($app->getName() != 'site' || $doc->getType() !== 'html')
{
return;
}
$router = $app::getRouter();
$uri = JUri::getInstance();
$domain = $this->params->get('domain');
if ($domain === null || $domain === '')
{
$domain = $uri->toString(array('scheme', 'host', 'port'));
}
$link = $domain . JRoute::_('index.php?' . http_build_query($router->getVars()), false);
if ($uri->toString() !== $link)
{
$doc->addHeadLink(htmlspecialchars($link), 'canonical');
}
}
in: /plugins/system/sef/sef.php