Advertisement
pusatdata

Joomla 2.5 - Removing the Article ID number

Aug 13th, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. Removing the Article ID number
  2.  
  3. On search engine friendly Joomla 2.5 sites, the URL of articles that are not directly linked to menu items includes an ID number. eg. www.hyde-design.co.uk/test/4-example. Here's how to disable them.
  4.  
  5. Using a file manager go to components / com_content and rename router.php to something else (eg. old-router.php).
  6.  
  7. Download this patch file.
  8.  
  9. Unzip it and upload the router.php file to components / com_content
  10.  
  11. If you have any problems then delete the new router file and rename the old file back to router.php
  12.  
  13. For those of you that wish to know which part of the file was updated, lines 27 & 208 have been changed from...
  14.  
  15. $advanced = $params->get('sef_advanced_link', 0);
  16.  
  17. to...
  18.  
  19. $advanced = $params->get('sef_advanced_link', 1);
  20.  
  21. This will remove the ID number but it will also cause an issue with pages where the alias is only one word long. To fix this comment out lines 228 to 232, so that...
  22.  
  23. if (strpos($segments[0], ':') === false) {
  24. $vars['view'] = 'article';
  25. $vars['id'] = (int)$segments[0];
  26. return $vars;
  27. }
  28.  
  29. becomes....
  30.  
  31. /* if (strpos($segments[0], ':') === false) {
  32. $vars['view'] = 'article';
  33. $vars['id'] = (int)$segments[0];
  34. return $vars;
  35. } */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement