SEF urls ("pretty urls") in Joomla

"SEF" means "Search Engine Friendly" urls. They are also "People Friendly". It means the urls of your pages look something like http://mysite.org/publications/tibet/history.html and not http://mysite.org/index.php?option=com_content&view=article&id=42

How to set SEF urls in core Joomla

Joomla does SEF urls if you set it in the Global Configuration.

  1. Login as admin, and go to Global Configuration
  2. In the right column is: SEO Settings
  3. Click everything "Yes"
  4. Put mouse over the yellow triangle and do what it says (.htaccess file!).
  5. Then Save.

Useful info:

How to make the SEF urls

Default: section/category
When SEF is set as above, by default, Joomla will make the "pretty url" with section/category. It only goes two levels down. After that it does use article titles, but also uses id number of the article. Like: http://mysite.org/publications/tibet/42-history.html

Sometimes it puts a category id on the section also, like http://mysite.org/publications/14-tibet/42-history.html

Useful info:

Better: Make with menu item
If you make a menu item for the article, Joomla will use the alias from there to make the url. With this i have been able to make urls with no id number, like: http://mysite.org/publications/tibet/history.html

Useful info:

 

SEF urls in extensions

In extensions you install:

Extensions don't use Joomla's SEF feature. So they don't do SEFs unless the author has written it in. (This is done in certain files which are "routers" ... these files tell Joomla how to turn the url for an extension into an SEF "pretty url", and how to turn the "pretty url" back again so the extension program can use it.)

When writing or modifying your own extension:

So when you write your own extension, you will also have to write a router if you want SEF's (which you do!). You could also add a router to an existing extension if it didn't have one.

A very good tutorial on writing SEF urls is in Learning Joomla Extension Development, by LeBlanc, Packt Publications, 2007 Chapter 4: Front-End Development, p.51-55 (This book is available as PDF file.) http://www.packtpub.com/learning-joomla-1.5-extension-development/book

 

Extensions to make better SEF urls

There are some extensions that are supposed to make it easier to make good SEF urls.
There is a list of SEF extensions at: http://extensions.joomla.org/extensions/site-management/sef

My impression to date (august 2009) is

 

Know more