Few web developers will deny that URLs based on keywords rather than numbers and meaningless strings make your urls prettier, more descriptive, and more attractive to search engines and humans alike. However, with the tons of options in how to implement SEF urls in your Joomla website it can be confusing on where to start. This post covers how to implement near-perfect SEF URLs with core joomla sef and the core content component.
How Standard Joomla URLs Work
Core Joomla URLs are all built off of the base "index.php" with various strings added to specify the content displayed from the database. These strings represent the component being accessed, the specific item being accessed from that component, and the view for the display.
For example, your homepage might be "http://www.example.com/index.php". To display a specific article from Joomla's content component, the simplest URL would include the name of the component (com_content), the view (single article) and the article's ID number:
http://www.example.com/index.php?option=com_content&view=article&id=23
The Itemid
There are multiple ways by which you could arrive at a particular article, and thus different ways that the URL can be displayed and different strings that can be appended to add in more information. One of the most important parts of a URL is the Itemid, which represents the menu item used to access the specific URL. Itemids for specific articles are "inherited" from the Itemid for the menu item that shows their category and/or section view.
You create a new Itemid when you create a menu item that links to anything. Core Joomla SEF URLs will not work correctly unless you have created category menu items for every category in your site. For example, your URL for a category blog layout page may look like this:
http://www.example.com/index.php?option=com_content&layout=blog&view=category&id=6&Itemid=53
This URL contains the component to be accessed (com_content), view (category blog layout), specific category (ID 6) and menu item's ID (Itemid 53).
How Joomla SEF URLs Work
With SEF URLs turned on Joomla uses the aliases of various parts of the URL to rewrite a "Search Engine Friendly" version of the core Joomla URL. Careful wording of aliases will allow you to specify the keywords that show up in URLs when you know how the URLs themselves are assembled.
So the standard URL for a category blog view menu item for the "Joomla News" category:
http://www.example.com/index.php?option=com_content&layout=blog&view=category&id=6&Itemid=5
would be rewritten as an SEF URL to:
http://www.example.com/joomla-news
assuming that the alias of the menu item is "joomla-news".
Further, for an article in the Joomla News category called "New Version of Joomla Released":
http://www.example.com/index.php?option=com_content&catid=6&view=article&id=124&Itemid=5
would be rewritten as an SEF URL to:
http://www.example.com/joomla-news/124-new-version-of-joomla-released
where "124" is the article's ID and "new-version-of-joomla-released" is the article's title alias.
How to Properly Enable SEF URLs
The first step is organizing your menu structure carefully. In this case that will mean creating category menu items in your main menu for each category (like this site). Then, go to your Joomla Global Configuration and set the parameters "Search Engine Friendly URLs" and "use apache mod_rewrite" to "yes". Your SEF URLs should then work properly.
Doctor's Orders
There are a ton of procedures to follow when using SEF URLs on a Joomla website and this post covers only the basics. Make sure you pay attention to title aliases and menu structure as you build your site and add content. You will likely go on to use an SEF extension like sh404 to refine your URLs but proper understanding of the basics is important. Stay tuned for more posts on how to get the most out of Joomla SEF urls.




Jesse Dundon is a founding partner at 
