Creating search engine optimized url for your component Azrul Rahim www.azrul.com
Why Bother ? <ul><li>Search engines analyze your URLs for keywords, and will highlight it in the result </li></ul><ul><li>...
 
Joomla 1.0 approach to SEF-url <ul><li>3 rd  party component required </li></ul><ul><ul><li>SEFAdvance </li></ul></ul><ul>...
Joomla 1.5 and SEF url <ul><li>SEF-url engine comes built-in with every installation of Joomla ! </li></ul><ul><ul><li>Wor...
sef-url in Joomla 1.5 <ul><li>Backend config </li></ul><ul><li>Specify menu title alias </li></ul><ul><li>Some limitations...
2 approach in SEF rewriting <ul><li>No caching, logic-based syetem. </li></ul><ul><li>create and resolve url on the fly </...
1. Non-caching <ul><li>(my preferred technique) </li></ul><ul><li>Able to resolve url that has never been used before </li...
2. Cached url system  <ul><li>url are created and saved </li></ul><ul><li>Little overhead to parse the url, need a single ...
Creating sef-url for your component <ul><li>Plan your url </li></ul><ul><li>List down all your required normal url </li></...
<ul><li>Create a file ‘router.php’ in your component folder </li></ul><ul><li>Create 2 function within router.php </li></u...
… BuildRoute(&$query) <ul><li>Take a reference to an array </li></ul><ul><li>$query is built from JRoute::_(…) function ca...
Notes & gotchas <ul><li>Do not add ‘.html’ to your SEF url, Joomla will add this automatically if required. </li></ul><ul>...
… ParseRoute($segments)  <ul><li>Called to resolve the segment-based url to their original url </li></ul><ul><li>Given an ...
Notes… <ul><li>Joomla convert the first dash ‘-’ to ‘:’ </li></ul><ul><li>There is no reliable way to encode/decode url th...
Other alternative <ul><li>SmartSEF ( www.smartsef.org ) </li></ul><ul><ul><li>Each sef plugin can have their own params </...
Questions & Discussions <ul><li>Please ask questions… </li></ul><ul><li>www.azrul.com </li></ul>
Upcoming SlideShare
Loading in …5
×

JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

2,467 views

Published on

Azrul.com presentation on SEF Search Engine Friendly URLs for JoomlaEXPO 2008 in Chicago, Illinois.

Published in: Technology, Design
  • Be the first to comment

JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

  1. 1. Creating search engine optimized url for your component Azrul Rahim www.azrul.com
  2. 2. Why Bother ? <ul><li>Search engines analyze your URLs for keywords, and will highlight it in the result </li></ul><ul><li>avoid duplicate content issues </li></ul><ul><li>Default Joomla SEF url are very common </li></ul><ul><li>URL should be friendly to us, HUMAN. </li></ul><ul><ul><li>Better click through rate </li></ul></ul><ul><ul><li>visitor know what to expect </li></ul></ul><ul><li>Make your site looks more professional! </li></ul>http://www.alledia.com/blog/joomla-urls/in-defense-of-search-engine-friendly-urls/
  3. 4. Joomla 1.0 approach to SEF-url <ul><li>3 rd party component required </li></ul><ul><ul><li>SEFAdvance </li></ul></ul><ul><ul><li>OpenSEF </li></ul></ul><ul><ul><li>sh404SEF </li></ul></ul><ul><li>Each one uses different approach </li></ul><ul><li>Need to maintain separate plug-in for each component. </li></ul>
  4. 5. Joomla 1.5 and SEF url <ul><li>SEF-url engine comes built-in with every installation of Joomla ! </li></ul><ul><ul><li>Works with/without mod_rewrite </li></ul></ul><ul><ul><li>Nice human-readable url </li></ul></ul><ul><li>Not as flexible as 3 rd party component </li></ul><ul><li>No url caching </li></ul>
  5. 6. sef-url in Joomla 1.5 <ul><li>Backend config </li></ul><ul><li>Specify menu title alias </li></ul><ul><li>Some limitations </li></ul><ul><ul><li>No choice over url suffix. One will be assigned automatically. </li></ul></ul><ul><ul><li>Potential multiple link to the same content </li></ul></ul><ul><ul><li>If multiple menu item use the same link title, only the first will be accessible </li></ul></ul>
  6. 7. 2 approach in SEF rewriting <ul><li>No caching, logic-based syetem. </li></ul><ul><li>create and resolve url on the fly </li></ul><ul><li>Cached url system </li></ul>
  7. 8. 1. Non-caching <ul><li>(my preferred technique) </li></ul><ul><li>Able to resolve url that has never been used before </li></ul><ul><li>Twice the amount of work to develop the plugins </li></ul><ul><li>Example </li></ul><ul><ul><li>OpenSEF </li></ul></ul><ul><ul><li>sefAdvance </li></ul></ul><ul><ul><li>Joomla 1.5 default </li></ul></ul><ul><ul><li>SmartSEF </li></ul></ul>
  8. 9. 2. Cached url system <ul><li>url are created and saved </li></ul><ul><li>Little overhead to parse the url, need a single database call </li></ul><ul><li>Normally require only the code to ‘create’ the url </li></ul><ul><li>url has to be created first, otherwise it cannot be resolved </li></ul><ul><li>Can break your site, damage your SEO ranking when cached cleared </li></ul><ul><ul><li>sh404SEF </li></ul></ul><ul><ul><li>smartSEF </li></ul></ul>
  9. 10. Creating sef-url for your component <ul><li>Plan your url </li></ul><ul><li>List down all your required normal url </li></ul><ul><li>List down how they should look like, SEF-ed </li></ul><ul><li>Tips </li></ul><ul><ul><li>“ Human readable!” </li></ul></ul><ul><ul><li>Meaningful, with a hint of the content </li></ul></ul><ul><ul><li>Contain targeted keywords </li></ul></ul>
  10. 11. <ul><li>Create a file ‘router.php’ in your component folder </li></ul><ul><li>Create 2 function within router.php </li></ul><ul><ul><li>function [Com name]BuildRoute( &$query ) </li></ul></ul><ul><ul><li>function [Com name]ParseRoute( $segments) </li></ul></ul>
  11. 12. … BuildRoute(&$query) <ul><li>Take a reference to an array </li></ul><ul><li>$query is built from JRoute::_(…) function call, split-up into array </li></ul><ul><li>Return value should be an array, </li></ul><ul><ul><li>$segments = array() $segments[]=‘path1'; $segments[]='path2'; $segments[]='file'; </li></ul></ul><ul><ul><li>Will create path1/path2/file.html </li></ul></ul><ul><li>Need to unset all variables that you have assign a segment </li></ul>
  12. 13. Notes & gotchas <ul><li>Do not add ‘.html’ to your SEF url, Joomla will add this automatically if required. </li></ul><ul><li>Create a menu entry to use component ‘alias’ . Otherwise, it will show as ‘/components/com_name/…’ </li></ul><ul><li>Alias has to be unique. If there is a duplicate, only the first link will be accessible </li></ul>
  13. 14. … ParseRoute($segments) <ul><li>Called to resolve the segment-based url to their original url </li></ul><ul><li>Given an array with url segment </li></ul><ul><li>Return array of actual $_GET values </li></ul>
  14. 15. Notes… <ul><li>Joomla convert the first dash ‘-’ to ‘:’ </li></ul><ul><li>There is no reliable way to encode/decode url that might contain combination of dash and double colon </li></ul><ul><li>Where do we specify Itemid ? . Don’t worry, menu alias will take care of it! </li></ul>
  15. 16. Other alternative <ul><li>SmartSEF ( www.smartsef.org ) </li></ul><ul><ul><li>Each sef plugin can have their own params </li></ul></ul><ul><ul><li>Sitemap support </li></ul></ul><ul><ul><li>Some security check </li></ul></ul><ul><li>SEFAdvance </li></ul><ul><li>Sh404 </li></ul><ul><ul><li>H1 tags </li></ul></ul><ul><li>SEF Patch (joomlatwork.com) </li></ul><ul><ul><li>(metadata/no-follow) </li></ul></ul>
  16. 17. Questions & Discussions <ul><li>Please ask questions… </li></ul><ul><li>www.azrul.com </li></ul>

×