Yireo - Extensions, tutorials and blog for Magento and Joomla!

Blog Tags

MageBridge Standard

TinyURL for Joomla!

Tuesday, 04 May 2010

Whenhandling URLs a common problem is that the URL generated by Joomla! can be actually very long - with or without SEF. This is why webservices like TinyURL and bit.ly are so populair. But it would be much cooler to do something similar in Joomla!, wouldn't it? Dynamic404 gives you this alternative.

An example

On our Yireo site we have an interesting article on how to write your own Joomla! splitmenu. But the URL itself is kind of long:

http://www.yireo.com/tutorials/joomla/joomla-templating/253-writing-your-own-joomla-splitmenu

While you could use a program like sh404SEF or SEFAdvance to create a custom URL for this, we don't recommend this. Actually the URL above is just fine: It very much shows the structure of our site (Tutorials > Joomla! > Joomla! Templating > Writing your own Joomla! splitmenu). If you strip the last segment of the URL, you end up every time at a valid page:

http://www.yireo.com/tutorials/joomla/joomla-templating/
http://www.yireo.com/tutorials/joomla/
http://www.yireo.com/tutorials/

Shortcuts with Dynamic404

Dynamic404 is used for redirecting the default 404-page to another page. This makes sure your visitors are never confronted with a blunt 404-page, but it opens up for nice tricks as well. What if we generate a 404-error on purpose?

http://www.yireo.com/writing-your-own-joomla-splitmenu

This URL will cause a 404, but Dynamic404 will see that the string "writing-your-own-joomla-splitmenu" is the alias of a certain Joomla! article and redirect to the same article. But it can get even shorter:

http://www.yireo.com/splitmenu

Actually this is a bit of a gamble. Dynamic404 will search for article-titles with the word "splitmenu" in it. In our case, we only have one match, but if there were many, Dynamic404 uses a weird point system to determine which match is the best and redirect to it.

Identifiers

Instead of using the alias, you can also use the ItemID of the Menu-Item. Again the following URL will cause a 404-error, but Dynamic404 sees the 404, reads the number and redirects to the right URL.

http://yireo.com/253

Custom rules

Instead of relying on automatic rules, you can also add manual rules to Dynamic404. For instance the following URL does not match any alias on our site, but still redirects to the right page, thanks to a manual rule within Dynamic404.

http://yireo.com/wrong-link

This shows you how flexible our Dynamic404 can be. Hope you see the benefit of Dynamic404. It is available in our store for a mere 20 Euros.

Tags: magebridge

About Yireo

Yireo tries to help webdevelopers build successful Joomla! and Magento sites.

More about Yireo