Change suffix from html to htm in Joomla
Joomla core sef has been proved as the best and light weight SEF solution for the Joomla sites. Instead of using the 3rd party extensions, you can just use the Joomla core sef.
Ok, Joomla core sef has a feature, where it adds the URL suffix as .html to all of the site generated URLs. If you want to change that suffix to .htm , then here is the solution :
Goto includes/router.php
Line 57 : Replace the current code there with ,
{
if($suffix = pathinfo($path, PATHINFO_EXTENSION))
{
$path = str_replace('.'.$suffix, '', $path);
$vars['format'] = $suffix;
if ($suffix == 'htm') {
$path = str_replace('.'.$suffix, '', $path); //pair of single quotes inserted
$vars['format'] = 'html';
} else {
$path = str_replace('.'.$suffix, '', $path); //pair of single quotes inserted
$vars['format'] = $suffix;
}
}
}
Then goto line 101 : Replace the current code there with ,
{
if($format = $uri->getVar('format', 'html')){
//$route .= '.'.$format;
//$route .= '.'.$format;
$route .= '.htm';
$uri->delVar('format');
}
So that will change it from .html to .htm. If you need the suffix to change from .html to .php , then just replace the .htm in the above code by .php and thats it.. if you are still not able to do it, then just download this router.php file and upload it to includes folder. Thats it.. If you still have got problems, then feel free to contact us.





joomlaservices
joomlaservices
394295112
joomlaservices
+91-9853090816
joomlaservices

Comments