Creating easily understandable URL's is very important. If you look at a URL, you should be able to guess the subject of the page the URL is created for. Ideally, also the focus keyword for that particular page should be included in the URL. The URL is actually a quite important SEO parameter, so pay attention to this. In many CMS's, like Joomla, it is very important to choose a base-configuration for your URL-creation. Getting this right from the start is extremely important. Having to change this in a later stage can cause you all kinds of trouble. As an example: if you change the HTML-suffix in the Global Configuration from Yes to No, all your URL's will break, as the .html suffix will be stripped, while Google still has them indexed.
URL's in Joomla
When configured incorrectly, Joomla generates URL's that cannot be easily understood, like this example:
This is completely meaningless to both users and search engines of course, and it should be presented as something more readable, like this:
In earlier versions of Joomla, you had to manually adjust your settings to achieve this. Happily this is not necessary anymore. Joomla ships with a much better base configuration. Still though, there is a lot of tuning that can be done. First, always go to Global Configuration and check the SEO settings:
The first parameter that you should always make sure is switched on is Search Engine Friendly URL's. This will achieve the readable URL's we just discussed, but luckily this is the default setting.
Secondly, we need to consider the Use URL Rewriting parameter. With this switched off (which is the default setting), your URL's are readable, but they still always start with index.php/. Preferably, we should remove this as well: Set the parameter to Yes, and at the same time, rename the file htaccess.txt (in the root of your Joomla site) to .htaccess. This needs to be done at the same time. It only works on Apache servers, but 95% of the hosts run on these, so this should seldomly be a problem. If you are using a local site on your windows PC, you may notice that you cannot rename a file without an extension, so you should go to a DOS-prompt in the correct folder and type:
rename htaccess.txt .htaccess
Thirdly, you have the possibility to add a suffix to you URL's, like .html. For SEO this is useless, so leave it off. The following 2 parameters do not affect URL's, but are still important:
Unicode Aliases should be better left untouched.
And finally, we have the Include Site name in Page Title's parameter. If you have a site name that makes sense for SEO, include it, either before or after the description. Also, be aware that having the sitename included in the page title limits you in setting it up exactly as you want it: you have less characters (out of the allowed 60 or so), to make it unique. That is why I usually don't include it and only add it on pages where I really want it, like the homepage.
Since Joomla 3.8, we have some new base options for our URL's: URL Routing. Many people don't even know it exists, but you can find it in the settings of each component. So for Joomla core stuff, go to the Options button in the Articles overview. Actually, you see it in action in this animated GIF:
If you head over to the Integration tab, you will see an option called URL Routing (it's located here because you can switch on per component). By default, it is set to Legacy and if you leave it like that, really nothing will change and URL's will be built using the pre-Joomla-3.8 procedure. If you use Modern though, the new routing mechanism will be activated, which is a lot more efficient. However, your URL's will still remain the same. Make sure to test this, but most probably you will see no changes.
However, you may also notice that a new option popped up after changing Legacy to Modern, called Remove IDs from URLs. Well, no explanation needed, it will do just that: remove the ID from items that are shown in Blog and List overviews. In the old situation, you could have a URL like this:
Using the Modern settings removes the article-ID:
And your URL's are nice and clean! Of course you may wonder what you should with this option:
This is definitely the way to go for new sites. However, existing sites should either leave the Legacy mode or use Modern with the Remove-ID setting left to No. Never change URL's just like that, it could have serious SEO consequences! If you do decide to use the new structure and change your URL's, make sure to reroute them using a 301-redirect (there is no automatic redirection from legacy to modern URL's!).
URL's are based on Menu-item or Article title
Now that the base configuration is in place, we can look at how URL's for individual article's and menu-items are generated:
- For menu-items, the URL is built based on the alias of the actual item, which is appended to a possible parent menu-item. So, if your menu-item is called Business hours, with a parent menu-item of Contact, the URL will become /contact/business-hours.
- For articles, it depends on whether they are linked to a menu-item. If they are, the URL is based on this menu-item. If not, the URL is based on (for Legacy routing) the Item-ID of the article plus the actual Article-alias. As an example: if your article is called How to make soup, the URL could be something like /46-how-to-make-soup.
Knowing this, you can either tune your aliasses for perfect URL's, but you can also customize your aliases, as the alias is used as the actual base for URL's.