Joomla! uses two types of URLs: Non-SEF URLs (also called System URLs) and SEF-URLs (Search Engine Optimized URLs). Since System URLs make extensive use of numeric IDs, there's no logical guessing to be done here. Dynamic404 will therefor only work with SEF enabled.
The alias and the MySQL ID
SEF URLs can be constructed in two different ways: The first method involves the so-called slug - a combination of the numeric ID and the alias. Take for instance the article "Joomla!TM License Guidelines". When saving this article, the title is automatically converted into the alias "joomla-license-guidelines".
If a link to this article is shown from within the module "Latest Articles", the URL might look like the following:
/legal-issues/5-joomla-license-guidelines
Here "legal-issues" refers to a parent Menu-Item, while the article alias is also visible, but accompanied by the number 5 which is the MySQL identifier for the article.
When the MySQL ID of a content-item is present in the URL, Joomla! will use that number instead of the alias. So, if a visitor makes a typo in the URL like the following, the article with MySQL ID 5 is still being loaded.
/legal-issues/5-jomla-license-guydelines
No MySQL ID
Things become more complicated when the ID is omitted. This is the case for most URLs in Joomla!.
/legal-issues/joomla-license-guidelines
If a visitor makes a typo here, there is no MySQL ID acting as backup logic. A 404 page is the result.
/legal-issues/jomla-license-guydelines
Using Dynamic404 without any customizations, this will also deliver a 404 page. There is just nothing to match "jomla-license-guydelines". But you could create a so-called redirect rule to rewrite "jomla-license-guydelines" to "joomla-license-guidelines" automatically. With Dynamic404 you can even redirect all URLs with the word "license" to "joomla-license-guidelines".
Wrong pathing
Typos can occur anywhere, not only in the end of the URL:
/legal-issssues/joomla-license-guidelines
Joomla! will throw a 404 page here, because it doesn't know to which Menu-Item this URL belongs. Dynamic404 will take the "joomla-license-guidelines" part and look for any match in the database. It will look through Menu-Items and articles, and return any match found.
This works out of the box, and does not require any configuration.
Creating custom rules
If no automatic redirect is taking place, you can add special rules from within the Dynamic404 backend. These rules have the following parameters:
- Match: The part of the URL that this rule will match. Which part of the URL should be entered here depends on which type of rule you choose to create. The different types are discussed later on.
- URL: The destination URL the 404 page should be redirected to. This could be a relative URL inside Joomla! but also an absolute URL to any other website (starting for instance with http://).
- Description: An internal description to be used for your own convenience.
- Published: Whether this rule should be activated or not.
- Order: The ordering of rules could be of importance, but this is not necessarily so. Each rule gets its own rating - rules with a high rating are considered better matches than rules with a lower rating. Rules with the same rating are ordered through the order field. Using a rating system instead of just ordering allows for better fine tuning. This makes more sense because a match based upon a Menu-Item could be considered more important than a match based upon a custom rule. But sometimes the reverse could be needed.
Custom rules open up for interesting opportunities: You could create some kind of tracking URL for newsletters that automatically redirects to the right page. Also, you can use your own short URL system by allowing visitors to enter a short URL which then redirects to a longer URL.
Match the full URL
Custom rules come in different types. The type determines how the match argument should be interpreted. The first type is Match the full URL. Let's say the match parameter has the following value:
legal-issues/joomla-license
This is only being matched if the Joomla! URL looks like this:
http://example.com/legal-issues/joomla-license
Match the last URL segment
Joomla! SEF seperates URL segments by using a slash (/). The URL "legal-issues/joomla-license" has therefor two segments and "joomla-license" is the last segment. Using the type Match the last URL segment you can redirect 404-pages based upon this last segment.
For instance you could use as match "joomla-lisence" (s and c swapped around) and redirect to the URL "legal-issues/joomla-license". Note that you need to fill in a complete valid URL as destination. If you do not and the redirect URL encounters yet another 404-page, you could have created an endless redirection-loop.
Match any URL segment
The type Match any URL segment is able to match any segment in the URL. Instead of creating a large amount of specific 404-rules, you can redirect all 404-pages with a specific category in the URL to a general page which serves as a jumping point. This is for sure much better than just redirecting to the homepage.
Let's say you have removed a large amount of articles in a specific category, then you could redirect all the 404-pages for those articles to the blog-category of that category. Ofcourse this only works if the category-alias is actually part of the obsolete URL.
Partially match the last URL segment
One of the more complex types is the type Partially match the last URL segment. It's dangerous because if used incorrectly it could override other rules easily. The type allows you to match any word in the last URL segment. Instead of matching the exact URL-string, it allows for matching based upon keywords. We ourselves had a couple of articles on PHP programming which we removed. Using this type, we match URLs with the keyword "php" and redirect them to a general article.
Assigning different ratings
You could choose to configure ratings differently. If doing so, make sure you test out enough URLs to see if it is working. By default, custom rules get the highest rating (90), but if a Menu-Item is a more likely match it could be getting a higher rating.
Rating is not straight-forward and Dynamic404 aims to use some kind of fuzzy logic to determine the best option. For instance, when a 404-page has an URL of four segments and the last segment is matching, this is given a higher rating than if the 404-URL would have five segments.
Most of the Dynamic404 logic is configurable and the logic that is not should be considered as is.


