Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
better explain
Source Link
Norak
  • 111
  • 5

I have some sections of my web in joomla that are accessed like this:

http://miweb.com/index.php?option=com_component&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

I want to transform in something like that:

http://miweb.com/index.php?option=com_newname&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

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

I have some sections of my web in joomla that are accessed like this:

http://miweb.com/index.php?option=com_component&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

I want to transform in something like that:

http://miweb.com/index.php?option=com_newname&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

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

I have some sections of my web in joomla that are accessed like this:

http://miweb.com/index.php?option=com_component&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

I want to transform in something like that:

http://miweb.com/index.php?option=com_newname&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

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

better explain
Source Link
Norak
  • 111
  • 5

I have some sections of my web in joomla that are accessed like this:

http://miweb.com/index.php?option=com_component&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

I want to transform in something like that:

http://miweb.com/contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319bahttp://miweb.com/index.php?option=com_newname&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

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

I have some sections of my web in joomla that are accessed like this:

http://miweb.com/index.php?option=com_component&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

I want to transform in something like that:

http://miweb.com/contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

It's possible? How can I do it?

I have some sections of my web in joomla that are accessed like this:

http://miweb.com/index.php?option=com_component&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

I want to transform in something like that:

http://miweb.com/index.php?option=com_newname&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

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

Source Link
Norak
  • 111
  • 5

Shorten some URLs and show them to the user in another format

I have some sections of my web in joomla that are accessed like this:

http://miweb.com/index.php?option=com_component&view=contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

I want to transform in something like that:

http://miweb.com/contracts&ff=1&id=20977&token=8f8c54a3ce165332fd59f17319ba

It's possible? How can I do it?