Learn how you can change SEF links with settings and language translations
Ofter default URL does not satisfy Cobalt users. And I understand that. We are using very simple method to build URLs. And here we have to understand our position.
We will not make produce or implement anything in Cobalt that will increase number of SQL queries, thus affect Cobalt performance.
Long ago when we made extensions for Joomla 1.0 under JomlaEquipment brand, we had one of the most popular SEF extensions called JPromoter. We know what it is to manage SEF URls and what a cost or consequences are of a simple desire to make URLs little bit more beautiful.
While optimization of SEF URLs use simple rule.
URLs are not for people. URLs for search crawlers.
This is wonderful when URLs are good organized. But at the end who cares? At the end most important is the fact how link is treated by search crawler more than how visitor likes the URL. Please look as example links of youtube and facebook.
This is link to one of user pictures.
Or look at google search URL.
Not even close to
And who cares? Why should google or youtube be concerned about that? Do you really think some one will quite to use website because he do not like URLs it generates?
Conclusion: When we make decision most important is how crawlers see the link rather than how visitors see (beauty of) the link.
One of the most wanted features is to take IDs off the URL. Bet here is the matter. Assuming we have URL like:
Where 226 is and ID of an item. And we can get this easily from the URL.
But if we have something like this.
To get ID of the item which we need to display item we have to run query to DB to retrieve ID based on URL.
The same for creation of this URL we have to make at least one query to DB and sometimes 2. First to check if URL already saved and second save it if it is not yet saved.
Imagine we have 100 links on single page. This is at least 100 additional queries. This is at least 1 additional second. And believe me 1 second is good. I know sites where SEF routing tales up to 5 seconds.
This is why we will never create something like this in Cobalt. But it does not mean you cannot use it. There are third party SEF extensions integrated with cobalt like MijoSEF for example. And this extension can give you what you want.
Conclusion: Never sacrifice performance for sake or beauty. You will lose more on slowness of your site then earn on beauty of the link and for crawler it really makes no different if you have IDs in URL or not.
But something we can do about SEF URLs in Cobalt. We use key-based URL structure. This simple means that first URL segment is a key that tells cobalt what is the type of URL and how to parse it.
Let’s parse few links
depotis the part of Joomla menu structure. Or menu element alias. In simple URL it is Itemid parameter.
itemare Cobalt keys
Keys are text variables. This means we can translate them and those are different on every language. You can override those variables in Joomla -> Extensions -> Language Manager -> Overrides
Here is the full list of keys you can override. Usually people want to shorten it.
It happens often that alias of section is the same as alias of menu. For example you have section forum and you have link in menu also forum. When you navigate to category link will be something like.
Here we see forum word twice. First is an alias of menu element and second is an alias of section. You cannot hide anything there but you can use it to make some profit. We know that words in the URL are very important for SEO. We can use it to put something important. For example if we change aliast of section forum to community we will get link with additional search keyword.
Cobalt gives you ability to change aliases of Sections, categories and article, thus you can use it to create best URLs possible.
Cobalt has system where you can chose your own router. Joomla loads
router.php file from the root of extension. In Cobalt this file loads another file which you can set in global Cobalt parameters.
Those files are in folder
routers. Right now there is only one router
main_router.php but you can copy this files and give it new name. And then select it in Cobalt config.
You can change this file as you want. You can hide aliases or even make SEF based on SQL queries and hide IDs.