Como mudar joomla url sufixo
-
05-07-2019 - |
Pergunta
Eu estou usando Joomla Sef URLs e seu funcionando bem, exceto que eu preciso '.htm' sufixo em vez de '.html', por favor ajuda.
Actualmente os meus URLs aparecem como:
www.mysite.com/my-page.html
Eu quero que seja como
www.mysite.com/my-page.htm
Solução
Você vai querer usar uma das extensões de link 3rd Party amigável Search Engine: http : //extensions.joomla.org/extensions/site-management/sef
Outras dicas
Aqui é um patch. Testado no meu Joomla 1.5.9 (standard empacotado SEF):
Index: includes/router.php
===================================================================
--- includes/router.php (revision 13023)
+++ includes/router.php (working copy)
@@ -57,8 +57,13 @@
{
if($suffix = pathinfo($path, PATHINFO_EXTENSION))
{
- $path = str_replace('.'.$suffix, '', $path);
- $vars['format'] = $suffix;
+ if ($suffix == 'htm') {
+ $path = str_replace('.'.$suffix, '', $path);
+ $vars['format'] = 'html';
+ } else {
+ $path = str_replace('.'.$suffix, '', $path);
+ $vars['format'] = $suffix;
+ }
}
}
}
@@ -93,7 +98,8 @@
{
if($format = $uri->getVar('format', 'html'))
{
- $route .= '.'.$format;
+ //$route .= '.'.$format;
+ $route .= '.htm';
$uri->delVar('format');
}
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow