Upgrade Joomla 1.5 to Joomla 1.6

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.

Comments

avatar Myo Zar Ni Aung
0
 
 
thanks for your help
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
avatar Andrea
0
 
 
Thanks for your help..but i have a problem. I changed to .php like you suggested but it still gives me the .html, and dunno what to change else.. :/
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
Cancel
Name *
Email (For verification & Replies)
URL
Code   
Submit Comment
button_logo_portfolio
button_quote
button_testimonials

Subscribe Tutorials

Enter your email address:

Paypal Donation

Enter Amount:

Subscribe Joomla Tutorials Newsletter

Name:

Email:


Enter your email address: