joomlaexpo: search engine friendly urls - azrul.com

17
Creating search engine optimized url for your component Azrul Rahim www.azrul.com

Upload: john-coonen

Post on 08-May-2015

2.269 views

Category:

Technology


1 download

DESCRIPTION

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

TRANSCRIPT

Page 1: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Creating search engine optimized url for your component

Azrul Rahim

www.azrul.com

Page 2: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Why Bother ?

• Search engines analyze your URLs for keywords, and will highlight it in the result

• avoid duplicate content issues• Default Joomla SEF url are very common• URL should be friendly to us, HUMAN.

– Better click through rate– visitor know what to expect

• Make your site looks more professional!

http://www.alledia.com/blog/joomla-urls/in-defense-of-search-engine-friendly-urls/

Page 3: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com
Page 4: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Joomla 1.0 approach to SEF-url

• 3rd party component required– SEFAdvance– OpenSEF – sh404SEF

• Each one uses different approach

• Need to maintain separate plug-in for each component.

Page 5: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Joomla 1.5 and SEF url

• SEF-url engine comes built-in with every installation of Joomla !– Works with/without mod_rewrite– Nice human-readable url

• Not as flexible as 3rd party component

• No url caching

Page 6: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

sef-url in Joomla 1.5

• Backend config

• Specify menu title alias

• Some limitations– No choice over url suffix. One will be assigned

automatically. – Potential multiple link to the same content– If multiple menu item use the same link title,

only the first will be accessible

Page 7: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

2 approach in SEF rewriting

• No caching, logic-based syetem.

• create and resolve url on the fly

• Cached url system

Page 8: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

1. Non-caching

• (my preferred technique)• Able to resolve url that has never been used

before• Twice the amount of work to develop the plugins• Example

– OpenSEF– sefAdvance– Joomla 1.5 default– SmartSEF

Page 9: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

2. Cached url system

• url are created and saved• Little overhead to parse the url, need a single

database call• Normally require only the code to ‘create’ the url• url has to be created first, otherwise it cannot be

resolved• Can break your site, damage your SEO ranking

when cached cleared– sh404SEF

– smartSEF

Page 10: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Creating sef-url for your component

1. Plan your url

2. List down all your required normal url

3. List down how they should look like, SEF-ed

4. Tips1. “Human readable!”

2. Meaningful, with a hint of the content

3. Contain targeted keywords

Page 11: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

1. Create a file ‘router.php’ in your component folder

2. Create 2 function within router.php1. function [Com name]BuildRoute( &$query )

2. function [Com name]ParseRoute( $segments)

Page 12: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

…BuildRoute(&$query)

• Take a reference to an array

• $query is built from JRoute::_(…) function call, split-up into array

• Return value should be an array, – $segments = array()$segments[]=‘path1';$segments[]='path2';$segments[]='file';

– Will create path1/path2/file.html

• Need to unset all variables that you have assign a segment

Page 13: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Notes & gotchas

• Do not add ‘.html’ to your SEF url, Joomla will add this automatically if required.

• Create a menu entry to use component ‘alias’ . Otherwise, it will show as ‘/components/com_name/…’

• Alias has to be unique. If there is a duplicate, only the first link will be accessible

Page 14: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

…ParseRoute($segments)

• Called to resolve the segment-based url to their original url

• Given an array with url segment

• Return array of actual $_GET values

Page 15: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Notes…

• Joomla convert the first dash ‘-’ to ‘:’

• There is no reliable way to encode/decode url that might contain combination of dash and double colon

• Where do we specify Itemid ? . Don’t worry, menu alias will take care of it!

Page 16: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Other alternative

• SmartSEF (www.smartsef.org)– Each sef plugin can have their own params– Sitemap support– Some security check

• SEFAdvance• Sh404

– H1 tags

• SEF Patch (joomlatwork.com)– (metadata/no-follow)

Page 17: JoomlaEXPO: Search Engine Friendly URLs - Azrul.com

Questions & Discussions

Please ask questions…

www.azrul.com